[Closed] On/Off shaded material in viewport for all materials
Hi to all, i try to create a script for expand the effect of the button in material editor “show shaded material in viewport”. The standard button is active only for the selected material, but i search to adapt a version for all materials without need to select one.
It’s possible?
I’ve found this info: autodesk link
but i’m not much able with scripting yet…can you help me?
There you go…
(
for mat in (getClassInstances standard processAllAnimatables:true) do showTextureMap mat on
)
but this code is partial?
or can i copy it in maxscript listener? (it return me OK value, but nothing happens in viewport)
i’ve try off/on
vray materials and stansard materials (multisubobject)
edit:
right for standard material it’s ok, but i use vray…there is a solution?
In that case…
(
for mat in (getClassInstances vrayMtl processAllAnimatables:true) do showTextureMap mat on
)
And not to be picky over material types…
for mat in scenematerials where classof mat == material do showTextureMap mat on
Surely…
for mat in scenematerials where superClassOf mat == material do showTextureMap mat on
But it still won’t find materials inside multi/sub-object materials.
Woops yep sorry didn’t test it, and yeah you’re right about Multi-sub and VrayBlends and Vray2SidedMtls…
I’ve got a more complete function somewhere but don’t think I can share it unfortunately.
I don’t know of a better way other than going through all possible material types with getClassInstances. We need a getSuperClassInstances for situations like this.
This works here for materials inside vraymtl wrappers.
(
for mat in (getClassInstances vrayMtl processAllAnimatables:true) do showTextureMap mat on
for mat in (getClassInstances standard processAllAnimatables:true) do showTextureMap mat on
)