tyPreview appearance_lights error
There is an error in 3ds Max 2020 after run tyPreview appearance_lights:2
"tyPreview error: ((NitrousGraphicsManager.GetActiveViewportSetting()).lightOption) -- Runtime error: Unrecognized code: #defaultLight2"

We need to use DefaultLightMode property now.

And another bug in the tyPreview. Not sure if it needs a different post.

I'm replacing default max grabber with tyPreview and there is a for loop in my script where I run preview with different settings.
I noticed that some previews have strange pixels offset. After some research I've found that tyPreview creates good preview only in first iteration in a loop, but then it creates those previews with offset. Presumably because for loop doesn't wait for some tyPreview ending procedure and next tyPreview grab starting in some wrong state.

I've found a dirty fix on maxscript side:

    fn Grab i =
        f = @"D:\Downloads\tygrab\" + i as string
        tyPreview output_filename:f appearance_safeFrames:off
        colorman.repaintUI #repaintAll
    for i=1 to 2 do
        Grab i
These two strings together are fixing the issue:
colorman.repaintUI #repaintAll

3ds Max 2020.3
To reproduce this bug you can comment those 2 lines and grab some camera animation around a Teapot.
Of course I've already fixed it for myself, but tyPreview would be even better without this bug Smile
Thank you, the first problem will be fixed in the next build.

As for the second problem, can you post some example images/renders of the problem? I ran your code and commented out the lines and don't see a difference in the two previews. I brought both versions into AE and did a comparison and they are pixel-perfect equal.
I have this issue in max 2020 but not in 2016. What version did you test?
I tested 2021.
Also tested in 2020 and don't see the issue in there either. Identical results when overlayed in After Effects.

Do you have any other 2020 plugins installed which could interfere with viewport redraw?
Well, my max is 2020 update 3, so maybe you need exactly this upate 3 to reproduce the bug.
Anyway, I renamed ENU dir and also moved away some plugins from max dir.
Here is the list of plugins that was installed:
And still no luck, the issue is still here. Max is pretty clean now, and there are almost no plugins as you can see.

Here is how the issue looks like:

Btw my max 2021 is fine too. I have 16, 18, 19, 20, 21, 22... I can test this issue everywhere if you wish, but I don't think this could help you Smile
That's very strange....do the two lines of code you posted always fix the issue for you in all cases? Perhaps I will just call them behind the scenes myself to fix the issue on your side, even though I can't reproduce it. Not a great solution, but at least the problem wouldn't persist...
Always? I can't be 100% sure, but it seems good enough. I don't see any reason for this bruteforce method wouldn't work.

It's up to you of course. The fix looks dirty, but this is the only way I found. CompleteRedraw or anything else didn't help. Maybe there is a way in C++ SDK to redraw viewport/ui without full repaint.

If nobody have this problem except unlucky me, then maybe there is nothing to fix in tyFlow.
Maybe you could try to install update 3 for 2020? Just to make sure.
Ok, I'll add those lines to the next build...let me know if you run into the problem again, once it's released.
Fixed in v0.16119
Thanks, Tyson.

Forum Jump: