PDA

View Full Version : Select Objects by Material


mlanser
02-06-2007, 10:09 AM
Hi everyone.

I want to write a Script with the following functions:

The Script gets the material of the selected Object and selects all other Objects in the scene with the same material.

But actually i am not using scene materials. All materials are from a matlib that's included with loadMaterialLibrary, and then assigned with
obj.material = currentMaterialLibrary[3]

i don't have a clue how to find out what material the selected object's got, neither do i know how to select objects by materials.

Maybe you can help me out. Thanks in advance!

Zbuffer
02-06-2007, 12:31 PM
Hi,
Try this (not with Max ATM)

select (for o in geometry where o.material==$.material collect o)

mlanser
02-06-2007, 12:44 PM
Wow. Thanks a lot. That one really helped me out!

CGTalk Moderation
02-06-2007, 12:44 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.