Notifications
Clear all

[Closed] Iterating over standard materials?

Is there a way to iterate over all standard materials in a scene? Without having to check if its a multisub material etc?

So if I just want to check a setting in all standard materials for example…

4 Replies

the blur scripts have a material control script! download it from scriptspot…

 PEN
arrayOfStandMaterials=(getClassInstances standard)

Very easy.

Hi Paul,

getClassInstances works for materials, but when I tried it on some other classes, all I get is an array of classes. For example,

a = getClassInstances Box

I get,

#(Box,Box,Box,Box,Box,Box,Box,Box,Box,Box)

but,

classOf a[1]

returns Box.

You know what’s going on here? I’m using Max 7.

Thanks,
Stev

Ooops,

I was reading the docs, but I didn’t read far enough.

You have to use the refs stuct to get the nodes.

refs.dependentNodes a[1]

I still wonder though, it works one way for materials, but not for other nodes.

Stev