On/Off shaded material in viewport for all materials

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2012   #1
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?
 
Old 12 December 2012   #2
There you go...
(
	for mat in (getClassInstances standard processAllAnimatables:true) do showTextureMap mat on
)
 
Old 12 December 2012   #3
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

Last edited by kodo : 12 December 2012 at 12:38 PM.
 
Old 12 December 2012   #4
What type of materials are you using?
 
Old 12 December 2012   #5
vray materials and stansard materials (multisubobject)


edit:
right for standard material it's ok, but i use vray...there is a solution?
 
Old 12 December 2012   #6
In that case...
(
	for mat in (getClassInstances vrayMtl processAllAnimatables:true) do showTextureMap mat on
)
 
Old 12 December 2012   #7
wow...thank you very much...
the first test it's ok!
 
Old 12 December 2012   #8
And not to be picky over material types....

for mat in scenematerials where classof mat == material do showTextureMap mat on
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2012   #9
oohhh...after I try this version...
 
Old 12 December 2012   #10
Originally Posted by DaveWortley: 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.
 
Old 12 December 2012   #11
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.
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12 December 2012   #12
and how i can merge vraymaterial version with standard version?

another problem is with vraymtl wrapper or with vray override material, if is this the material applied at the object, the script doesn't function...some tips?

Last edited by kodo : 12 December 2012 at 03:06 PM.
 
Old 12 December 2012   #13
Originally Posted by DaveWortley: 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.

Originally Posted by kodo: and how i can merge vraymaterial version with standard version?

another problem is with vraymtl wrapper, if is this the material applied at the object, the script doesn't function...some tips?
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
)
 
Old 12 December 2012   #14
Originally Posted by Raytracer05: 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
 )


really?, to me does not work
 
Old 12 December 2012   #15
only ON version function with vraymaterial wrappers...the OFF version not function...why?
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:08 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.