autoexposure toggle button

hi, this is a very basic question, but I'm trying to make a button that alters the autoexposure state of vray.
I have the code to turn it on and pressing it again turns it off, but I would like the same button to work as a toggle.
So with the button on the autoexposure mode would be true and with the button off the autoexposure mode would be false.
Would it be possible to improve the code so that the button is somehow checked when the exposure state is true and the button is unchecked when the auto exposure is false?

if (renderers.current.camera_autoExposure == true) then (renderers.current.camera_autoExposure = false) else (renderers.current.camera_autoExposure = true)

what would the complete code

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

Try this:

macroscript miauuVrayCameraAutoExposure
category:"miauu"
tooltip:"VrayCameraAutoExposure"
buttonText:"VrayCameraAutoExposure"
(
	on isChecked do
	(
		if hasProperty renderers.current #camera_autoExposure do renderers.current.camera_autoExposure
	)
 
	on execute do
	(
		if hasProperty renderers.current #camera_autoExposure do
		(
			renderers.current.camera_autoExposure = not renderers.current.camera_autoExposure
		)	
	)
)
kino_unico's picture

thanks, but this script does

thanks, this script works perfect

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.