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   #16
Originally Posted by Raytracer05: We need a getSuperClassInstances for situations like this.

make it yourself:

for c in material.classes where c.creatable ...
 
Old 12 December 2012   #17
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 December 2012   #18
Thanks Denis...
(
	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 December 2012   #19
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 December 2012   #20
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 December 2012   #21
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 December 2012   #22
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 December 2012   #23
I'm not sure I did all the steps right, but it does not work!
 
Old 12 December 2012   #24
there are some bugs (different bugs) in almost all Vray materials... subanim indexes are screwed up. there is a work around:

(
	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 December 2012   #25
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 December 2012 at 12:37 PM.
 
Old 12 December 2012   #26
Using Denis's idea, this seems to work:
(
	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 December 2012   #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 December 2012 at 07:14 AM.
 
Old 12 December 2012   #28
Would you mind posting the rest of the error message from the listener. I can't replicate it here.
 
Old 03 March 2013   #29
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 March 2013   #30
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



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 03:53 PM.


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