Global user functions¶
User global functions¶
renderStacks runs some global functions after specific renderStacks events.
rsUserNetSubmit¶
If you define the global function rsUserNetSubmit, renderStacks uses it as the netSubmit handler.
The function must return a string message. renderStacks shows the message in a dialog after the submission. If the function returns an empty string (""), renderStacks treats the submission as a failure.
Use rstck.passname to get the name of the pass that renderStacks submits.
rsPreRsOpenFn¶
Runs immediately when the renderStacks UI opens. Use it to change a property of the rstck struct.
This example sets the secondary pool for Deadline and adds an item to the resolution dropdown.
global rsPreRsOpenFn
fn rsPreRsOpenFn = (
if SMTDsettings != undefined then (SMTDsettings.Pool2Name = "mySecondaryPool") -- Sets the secondary pool for Deadline
append rstck.resPreset "7680 x 4320 x 1.0" -- Adds an item to the resolution preset of the Resolution pmodifier
)
rsPostCreateFn¶
Runs at the end of the rstck struct creation. It runs in the "on create" event of the rstck struct. Thus, you cannot change a property of the struct here.
rsUserSetOutputPath¶
If this global function exists, it overrides the RenderOutput pmodifier and all manual setups. You must then control ALL render output settings yourself. renderStacks does not set an output path when this function exists.
This function runs in the ActivatePass function, immediately after renderStacks makes the output path from the RenderOutput* pmodifiers.
We strongly recommend that you set your output path in rsUserPreRenderFn, not in this function. To stop renderStacks from setting the output path but keep the other RenderOutput properties, make this function empty.
rsUserPreRenderFn¶
Runs immediately before the render starts. At this point, these steps are complete:
- The pass is active.
- All pmodifiers ran.
- The renderStacks pre-render function ran.
Thus, your scene is ready for the render. This function runs for each pass that renderStacks renders. To override a change that renderStacks made for a pass, do it here.
If you must run your own fixed function for the render output, run it here.
rsUserPostRenderFn¶
Runs after the render is complete and the renderStacks post-render script ran.
rsUserPreSubmitFn¶
Added in 1.221. This function runs immediately after you press the Net Submit button. If you submit 5 passes, this function runs only once, before all 5 submissions.
From 1.229, this function must return true, or the submission stops. Thus, you can use this function for your own submission code or your own sanity check.
rstck properties for global user functions¶
Your user function can get renderStacks data from these properties of the rstck struct:
- rstck.passname – the name of the active pass.
- rstck.passcam – the camera to render for the pass.
The overview of global user functions execution order¶
- renderStacks starts.
- renderStacks makes the
rstckstruct. - rsPostCreateFn
- rsPreRsOpenFn
- The UI opens.
- The network submission starts.
- rsUserPreSubmitFn
- Pass activation starts.
- rsUserSetOutputPath
- Pass activation ends.
- rsUserPreRenderFn
- renderStacks submits a pass.
- rsUserPostRenderFn
- …