ScriptSpot

Forum topic · General Scripting

how to create a button on toolbar to vray distributed render

By LeandroM · 2014-04-15

Description

Hello Guys!!!

I would like to create a only button in my toobar that changes the state of the vray distributed render to on or off.

I would also like that button show if the DR is on or off.

I could only do it with 2 buttons and I still can not showing that they are pressured state.

I try use the checked function, but is not work.

Here is my current script:


macroScript Leo_Distributed_render_On

            category:"Leo_DR" 
            internalCategory:"Distributed_Render" 
            tooltip:"Distributed_Render_ON" 
            buttontext:"DR ON"

(

	(
		renderers.current.system_distributedRender = true
	)	

)

----------------------------------------------------------------------------

macroScript Leo_Distributed_render_Off

            category:"Leo_DR" 
            internalCategory:"Distributed_Render" 
            tooltip:"Distributed_Render_OFF" 
            buttontext:"DR OFF"

(
		
	(
		renderers.current.system_distributedRender = false
	)

)

Thank you for your attention and sorry my bad english.

Comments (2)

.

miauu · 2014-04-15

This have to solve your problem.
Since I don't have Vray I can't test it.


macroScript Leo_Distributed_render_On 
category:"Leo_DR" 
internalCategory:"Distributed_Render" 
tooltip:"Distributed_Render_ON" 
buttontext:"DR ON"
 
(
	on isChecked return (renderers.current.system_distributedRender)
	on execute do
	(
		renderers.current.system_distributedRender = not (renderers.current.system_distributedRender)
	)	
 
)

LeandroM · 2014-04-16

It worked perfectly.

Thank you very much.