I’ve got a couple of callback scripts that I have running in max, one for preRenderChange and one for postRenderChange, basically it allows you to switch from VRay to Scanline and back and have your settings restored…
The preRenderChange callback stores vray settings
The postRenderChange callback restores vray settings
--Vray Render Settings Auto Load Callback
callbacks.addScript #preRendererChange "if (substring ((classof renderers.current) as string) 1 3) == \"V_R\" do (global aRenderProps = #();for o in (getpropnames renderers.current) do append aRenderProps (getproperty renderers.current o))" id:#DW_Tools
callbacks.addScript #postRendererChange "if (substring ((classof renderers.current) as string) 1 3) == \"V_R\" and aRenderprops != undefined do for i = 1 to (getpropnames renderers.current).count do (try(setproperty renderers.current (getpropnames renderers.current)[i] aRenderProps[i])catch())" id:#DW_Tools
I can’t work out where but during submitting to deadline the postrenderChange callback gets called twice, but the preRenderChanged doesn’t although it’s still being run from what I can tell or the postRenderChange wouldn’t run as aRenderProps would be undefined.
The end result is on a fresh session of max, with first deadline submission the render settings after submission are restored to default Vray settings and I can’t work out where it’s going wrong…
I can only imagine that somewhere Deadline is assigning VRay as the active renderer and invoking factory defaults before setting its own, but I can’t find anywhere in SMTD_Functions.ms that would cause that…