Notifications
Clear all

[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?

28 Replies

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

What type of materials are you using?

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
)

wow…thank you very much…
the first test it’s ok!

And not to be picky over material types…

for mat in scenematerials where classof mat == material do showTextureMap mat on
1 Reply
(@raytracer05)
Joined: 11 months ago

Posts: 0

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.

oohhh…after I try this version…

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.

3 Replies
(@raytracer05)
Joined: 11 months ago

Posts: 0

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
)
(@kodo)
Joined: 11 months ago

Posts: 0

really?, to me does not work 🙁

(@denist)
Joined: 11 months ago

Posts: 0

is it more than 3 lines of code long?

Page 1 / 3