i am trying to set up custom sanity check for vray frame buffer color corrections exposure in 3ds max. Need to check if it is 0 or if the correction is unchecked.
From it, you can see that checking the state of the frame buffer’s Exposure setting can be done using
vfbControl #exposure -- gets the checkbox state
vfbControl #getexposure --gets the Exposure value
The first one returns undefined when V-Ray is not the active renderer. It would fail with an error if V-Ray is not installed and thus vfbControl is not a valid function. It returns an array value with an integer (I assume for future compatibility it was not set to return a boolean) when V-Ray is actually the current renderer. The #getExposure also returns an array with the value as first element.
struct SMTD_Private_SanityCheckFunctions
(
fn CheckForVRayVFBexposure =
(
expOn = try(vfbControl #exposure)catch(undefined) -- get the value, catch if no V-Ray
if not isKindOf expOn Array then true -- return true if V-Ray is not there
else if expOn[1] == 1 then -- if V-Ray is active, check if Exposure is checked
(vfbControl #getexposure)[1] == 0.0 -- if it is, check the value of the slider
else true -- if not checked, return true because "there is no spoon"
)
)–end struct
This will return true if V-Ray is not installed, if V-Ray is not the current renderer, if the Exposure checkbox is not checked, and if the Exposure value is actually equal to 0.
It will return false only when V-Ray is the current renderer, the V-Ray Frame Buffer Exposure checkbox is checked, and the Exposure value is not equal to 0.0.