Notifications
Clear all

[Closed] On/Off shaded material in viewport for all materials

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?

only ON version function with vraymaterial wrappers…the OFF version not function…why?

make it yourself:


for c in material.classes where c.creatable ...

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.

This latest version seems to be the most efficient, but it is always the problem with the wrapper vraymaterial and off/false option!

it has to work anyhow. there should be a way.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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

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

I’m not sure I did all the steps right, but it does not work!

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
			)
		)
	)
)

also this script it’s ok only with multisub object material.
with vray material wrapper OFF doesn’t function.
:banghead:

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

Page 2 / 3