Notifications
Clear all

[Closed] Select Objects by Material

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!

2 Replies

Hi,
Try this (not with Max ATM)

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

Wow. Thanks a lot. That one really helped me out!