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, 04:11 PM   #16
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by Raytracer05
We need a getSuperClassInstances for situations like this.

make it yourself:
Code:
for c in material.classes where c.creatable ...
 
Old 12-07-2012, 04:14 PM   #17
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by DaveWortley
I've got a more complete function somewhere but don't think I can share it unfortunately.

is it more than 3 lines of code long?
 
Old 12-07-2012, 04:22 PM   #18
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
Thanks Denis...
Code:
( for c in material.classes where c.creatable == true do ( for mat in (getClassInstances c processAllAnimatables:true) do mat.showInViewport = false ) )
@Kodo - You're right about off not working for materials inside VRay wrappers. I've no idea why, it looks like a but to me.
 
Old 12-07-2012, 04:36 PM   #19
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
This latest version seems to be the most efficient, but it is always the problem with the wrapper vraymaterial and off/false option!
 
Old 12-07-2012, 04:43 PM   #20
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by Raytracer05
You're right about off not working for materials inside VRay wrappers. I've no idea why, it looks like a but to me.

it has to work anyhow. there should be a way.
 
Old 12-07-2012, 04:56 PM   #21
PiXeL_MoNKeY
Expert
 
PiXeL_MoNKeY's Avatar
Eric Craft
Dallas, USA
 
Join Date: Mar 2002
Posts: 5,669
I think it is a bug in the vray code. Some of the materials are very picky on what can and can't be done. For example, you can connect a Shell Material to a Vray Blend, but it renders as a fully transparent material, even if both materials in the Shell are VrayMtl.

-Eric
__________________
"The Evil Monkey hiding in your closet."
 
Old 12-07-2012, 05:17 PM   #22
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by denisT
it has to work anyhow. there should be a way.

ok. there is a way (tested on my machine)
# make a copy of vray sub material
# replace it with any other in its wrapper material
# set showInViewport of the copied material to whatever you want
# set the original (copied) material back to its wrapper
 
Old 12-07-2012, 05:34 PM   #23
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
I'm not sure I did all the steps right, but it does not work!
 
Old 12-07-2012, 06:10 PM   #24
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
there are some bugs (different bugs) in almost all Vray materials... subanim indexes are screwed up. there is a work around:
Code:
( temp = VRayMtl() for c in material.classes where c.creatable and matchpattern c.localizedname pattern:"VRay*" do ( for vmat in (getclassinstances c) do ( for k=1 to vmat.numsubs where iskindof vmat[k].value VRayMtl do ( m = copy vmat[k].value vmat[k].value = temp m.showInViewport = off vmat[k].value = m ) ) ) )
 
Old 12-08-2012, 10:40 AM   #25
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
also this script it's ok only with multisub object material.
with vray material wrapper OFF doesn't function.


thanks to the efforts of all, we hope to find a definitive solution ...

Last edited by kodo : 12-08-2012 at 12:37 PM.
 
Old 12-10-2012, 10:52 AM   #26
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
Using Denis's idea, this seems to work:
Code:
( local switch = false for c in material.classes where c.creatable == true do ( for mat in (getClassInstances c processAllAnimatables:true) do ( if (isKindOf mat VRayMtlWrapper) and (mat.baseMtl != undefined) then ( local bMat = copy mat.baseMtl bMat.showInViewport = switch mat.baseMtl = bMat ) else ( mat.showInViewport = switch ) ) ) )
 
Old 12-12-2012, 06:49 AM   #27
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
Hi, i've try the last version, but it returns me this error:
unknown property: "showInViewport" in undefined

and if i try one old script version, now i've always the same error, why?

Last edited by kodo : 12-12-2012 at 07:14 AM.
 
Old 12-12-2012, 09:55 AM   #28
Raytracer05
Frequenter
portfolio
Dan Brew
TSK group plc
Manchester, United Kingdom
 
Join Date: Jul 2010
Posts: 189
Would you mind posting the rest of the error message from the listener. I can't replicate it here.
 
Old 03-29-2013, 07:26 AM   #29
kodo
New Member
portfolio
Alberto Codognotto
Alberto Codognotto - IT01588760932
Fiume Veneto, Italy
 
Join Date: Oct 2006
Posts: 27
Hi to all, I left out a bit this thread because I haven't had time to make test.
But in the upcoming version of 3dsmax Design 2014 seems there is an option for control the quality of texture maps with nitrous...
I'll wait to see solve my problems with the new controls ...

Thanks for the support, I keep you informed!
 
Old 03-29-2013, 07:26 AM   #30
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 05:12 AM.


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