Notifications
Clear all

[Closed] Material Properties Question

Hi,

Is there a materialproperty that defines wether or not a material is used in the maxscene? I think there should be a property because in the Material Library you can see if a material is used or not (if there’s a square marked in the slot then it’s used)
I’ve been searching but I can’t figure this one out.

Thanks in advance!
D.

2 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

any material might be directly assigned to some node or be a sub-material of another assigned material (Multi, Blend, Shell, etc.). Some material can have dependency with some node not being assigned to it (Custom Attribute, Unwrap Modifier, …).
You can check dependency of some material and scenematerials using:


refs.DependencyLoopTest scenematerials theMaterial

Hi Dexter,

I would start by investigating the materials dependants


refs.dependents m

where m is your material.

Check this thread for discussion about recursively searching and swapping a material that is in the scene. This is difficult because a material could be in the material editor but not assigned to an object.

http://forums.cgsociety.org/showthread.php?f=98&t=756047&highlight=replace+material

Josh.