Ola,
Let's say i have a multimaterial, with standard submaterials in it, with a diffuse texture in each of the submaterial.
In the material editor, my current slot is on a diffuse bitmap node.
I want to access the parent standard material from here. Not the root multimaterial.
(Purpose is to rename the standard material as the diffuse name).
This is what i came with :
damat = for ref in refs.dependents (medit.GetCurMtl()) where (classOf ref == standardMaterial) collect ref
It works but i feel like it's a bit dirty to cycle into the node dependencies. Couldn't think of a better way to get a bitmap material parent. Ideas ?
Thanks!
Replies
Personally I would select the multimaterial node and recurse the materials.
It's an issue only with multi mat, else medit.GetTopMtlSlot get me the material. So i'll just put a warning to select bitmap direct parent when root mat is a multi.
Yeah i recurse the submaterials and rename them all at multi level. But when on a submaterial or its bitmap, i wanted to rename just that material. I guess it will only be at submaterial level then.
Thanks !
I just have to cycle into submaterials till i find one with the right diffuse. I just can't think backwards.
One day, i was looking for doing a certain thing in Maya. Found a post of a guy detailing nicely all the process, then realized that guy was me posting, like 4 years before. Cool story uh.
haha, yeah cool story bra