tyPreview appearance_lights error
#1
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.

   
  Reply
#2
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:

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


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
  Reply
#3
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.
  Reply
#4
I have this issue in max 2020 but not in 2016. What version did you test?
  Reply
#5
I tested 2021.
  Reply
#6
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?
  Reply
#7
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:
https://vimeo.com/549637080

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
  Reply
#8
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...
  Reply
#9
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.
  Reply
#10
Ok, I'll add those lines to the next build...let me know if you run into the problem again, once it's released.
  Reply
#11
Fixed in v0.16119
Thanks, Tyson.
  Reply


Forum Jump: