Home Technical Talk

[maxscript] selectByMaterial and setMaterialIndex weirdness

polycounter lvl 19
Offline / Send Message
Bryan Cavett polycounter lvl 19
I've been trying to track this bug down and could use some help. In this zip file is a scene and a script called "materialCombiner.ms"

http://www.bryancavett.com/materialCombiner.zip

The script is supposed to take the selected objects and combine their multi/sub materials in to one multi/sub then adjust the object's material ids accordingly so that when you run the script you should see no visual change. I have the script print out a list of the actions its doing and the actions are telling me that the material ids are changing to the correct value but this appears to be false. When you take a look at the models and inspect their ids they are incorrect. I cannot figure this out and it may be a bug in my script or in maxscript. If anyone would like to try it out on their end just load the scene, select the objects, and run materialCombiner from the BCTools category (after evaluating the script so that the macro gets installed). Has anyone else encountered any weirdness with the functions selectByMaterial or setMaterialIndex before?


Edit: and ofcourse after an hour of tracking this bug down and then giving up and posting to the boards I find the bug a second later.... Thread can be deleted lol
Sign In or Register to comment.