VRay Material Optimizer script crashes 3DSMax

Trying to use the Optimizer script on a very basic piece of geometry, and it crashes 3DS Max every time.

Object has a chamfer and a few UVW modifiers on it. (will include screenshot).

Any clue why this happens?

The VRScene comes into Unreal totally fine, but when building light, it gives me an error that states 62% lightmap overlap has occurred.

Textures are linked to a server drive (not locally on my desktop). Can this cause issues?

Hi cooldistrict,

Can you send us the sample scene so we can investigate? What Max and V-Ray versions are you using?

Best regards,
Alexander

This is the base Max scene. Obviously missing textures and ies profile (Materials are from the VRay Material Library Browser).

Could it be because I’m using a UVW Modifier set to UV Channel 2 for texture coordinates? Is that screwing up the Script (that puts the Lightmap UVs into channel 2)?

Using 3DS Max 2022.1, VRay 5 Update 1.3
Brick_Wall_Scene_01.zip (107 KB)

hi @Alexander.Atanasov, I hope all is well! We sent you a chat message as well. Did you have a chance to look into the scene we sent? The scene is just a simple test setup, to test the script. The MaterialOptimizer script is not functioning at the moment in max 2022.1 and Vray 5.1.3, it crashes and does not finish.. We are currently doing the process manually. Hopefully we can get the script to function, to save us time. Thank you!
Brick_Wall_Scene_01.zip (107 KB)

Hi cooldistrict,

Sorry or the delay. I have looked at the scene and the problem seems to be caused by the 2 UVW Map modifiers. Without them the script runs normally. When you run the script we generate a log file in “C:\Users\USER_NAME\AppData\Local\Autodesk\3dsMax\M AXVERSION - 64bit\ENU\scripts”. From the log it says that the flatten process(which is a Max functionality) causes the crash. We are investigating it for a fix and will inform you when there is some further development.

Best regards,
Alexander

Hello cooldistrict,

Could you try this version of the script. I believe it fixes the crash. Let me know how it goes.

https://drive.google.com/file/d/1JmU…ew?usp=sharing

Google drive opens the contents of the mzp file, which could make it harder to install. Please use the download button in the top right-hand corner:

Best regards,
Simeon

Thank you so much! It’s working now on basic stuff. Going to try using it on a whole scene and see if it holds up. Will report back once I get results.