Anyone know of a script which will select all objects in a scene based on their multi sub object material ID? Selecting an object by material doesn't respect material ID's so you just get every object with that multi sub material applied to it. I would have thought its something people want to do often but having looked…
The problem here is that objects don't have material ID's, only faces do. You can get around this by grabbing the material ID of a random face on the object and assuming that's the correct material ID. But, this breaks if you have multiple material ID's on an object.
Sounds like to do this properly, you'd have to get the total number of different material IDs in use, per object. If that total is 1, then you know the whole object is using just one material, and it's safe to just take the material ID of any face and know that it's applied to the whole object. Might be slow to iterate…
Thanks for the input chaps. The scene is huge (approx 9k objects not including Vray proxies) I found a script which detaches faces based on material ID which has helped to be able to isolate the material ID's into objects. Now i know that each object only has 1 ID it should be simpler.