Notifications
Clear all

[Closed] How can i enable disable vray render elements

Hi my friends , need to change the state of the vray render elements via maxscript, elements active its i want to change to disable all the render elements, i cant find the code to do this. Thank you in advance :D.

alez.

6 Replies

If you want to disable all the render elements (the check box at the top left of the render elements rollup):

(
	local reMgr = maxOps.getCurRenderElementMgr()
	reMgr.SetElementsActive false
)

Alternatively, if you want to turn the elements off individually: (NOTE this only works if you disable the VRay frame buffer)

(
	local reMgr = maxOps.getCurRenderElementMgr()
	
	for reI = 0 to (reMgr.numRenderElements()-1) do
	(
		local re = reMgr.getRenderElement reI
		re.enabled = true
	)
	
	renderSceneDialog.update()
)

Ey man!! thank you very much , works perfectly,

Can i make you a question? If i would want to add a new element , like velocity were can i find a reference code to see how can i adapt to my script ?

Thank you aganin man!!

alez.

Ok, I’m not sure where you can find reference code but if you’re using VRay then you can find all the VRay renderElements by typing into the listener:

showClass "vray*:*renderElement*"

If you look down the list you will see that the velocity element’s class name is VRayVelocity. Now if you want to find the parameters for VRayVelocity use:

show (VRayVelocity())

And to add a new velocity element with a maximum velocity of 100 the code would be:

(
	local reMgr = maxOps.getCurRenderElementMgr()
	vv = VRayVelocity max_velocity:100
	reMgr.addRenderElement vv
)

I hope that helps.

I present my respects to you, many thanks seriously.

I find this web

http://www.cgplusplus.com/online-reference/vray-properties/

But im a noob with maxscript , and i dont know well how is the syntax or the order of the code to make it work.

Thank you again man !!

1 Reply
(@raytracer05)
Joined: 11 months ago

Posts: 0

That could be useful but it looks like it is 5 years old. Vray has changed quite a bit in that time.

Post some of your code. I’ll try to help you make it work. And if I can’t someone else on here will be able to.

Remember, at any point you can use the “show” command followed by an object (including constructors) to find the properties. So you don’t really need an actual reference like that – it’s all there, in Maxscript! If you wanted to find out the properties of a VRayFur object, just whack…

show (vrayfur())

Into the Maxscript listener.