CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 12-07-2012, 09:29 AM   #1
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
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-07-2012, 12:06 PM   #2
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
There you go...
Code:
( for mat in (getClassInstances standard processAllAnimatables:true) do showTextureMap mat on )
 
Old 12-07-2012, 12:30 PM   #3
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
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-07-2012 at 12:38 PM.
 
Old 12-07-2012, 12:45 PM   #4
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
What type of materials are you using?
 
Old 12-07-2012, 12:47 PM   #5
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
vray materials and stansard materials (multisubobject)


edit:
right for standard material it's ok, but i use vray...there is a solution?
 
Old 12-07-2012, 12:50 PM   #6
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
In that case...
Code:
( for mat in (getClassInstances vrayMtl processAllAnimatables:true) do showTextureMap mat on )
 
Old 12-07-2012, 12:53 PM   #7
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
wow...thank you very much...
the first test it's ok!
 
Old 12-07-2012, 01:45 PM   #8
DaveWortley
<database error>
 
DaveWortley's Avatar
portfolio
David Wortley
Technical Director
London, United Kingdom
 
Join Date: Dec 2004
Posts: 1,864
Send a message via MSN to DaveWortley
And not to be picky over material types....

Code:
for mat in scenematerials where classof mat == material do showTextureMap mat on
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12-07-2012, 02:05 PM   #9
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
oohhh...after I try this version...
 
Old 12-07-2012, 02:48 PM   #10
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
Quote:
Originally Posted by DaveWortley
And not to be picky over material types....

Code:
for mat in scenematerials where classof mat == material do showTextureMap mat on
Surely..
Code:
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-07-2012, 02:49 PM   #11
DaveWortley
<database error>
 
DaveWortley's Avatar
portfolio
David Wortley
Technical Director
London, United Kingdom
 
Join Date: Dec 2004
Posts: 1,864
Send a message via MSN to 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.
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 12-07-2012, 02:58 PM   #12
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
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-07-2012 at 03:06 PM.
 
Old 12-07-2012, 03:20 PM   #13
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
Quote:
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.

Quote:
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.
Code:
( for mat in (getClassInstances vrayMtl processAllAnimatables:true) do showTextureMap mat on for mat in (getClassInstances standard processAllAnimatables:true) do showTextureMap mat on )
 
Old 12-07-2012, 03:29 PM   #14
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
Quote:
Originally Posted by Raytracer05
This works here for materials inside vraymtl wrappers.
Code:
( 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-07-2012, 03:40 PM   #15
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
only ON version function with vraymaterial wrappers...the OFF version not function...why?
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:26 PM.


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