The last main improvement for Render Setup feature is actually a new feature to render a sequence directly from Maya’s UI without executing a batch render (including support for loading the sequence in the Renderview for review), thanks to engineering team’s contribution, here is the detail if you are interested:
Introduction
Rendering of image sequences in Maya has traditionally been an offline process for the end-user via command-line or the batch render feature in Maya. This can be limiting for artists attempting to generate sequences locally, and imposed additional workflow to review and evaluate renders over time.
Interactive sequence rendering is a new rendering mode introduced in Maya 2017 that allows rendering of a sequence of frames into the Render View. It’s a mix between Batch rendering and ordinary Render View rendering. Like Batch rendering it will iterate over render layers, cameras and frames and save the results to disc, but like Render View rendering it’s done interactively, displaying the progress in the Render View. There is also an option to keep each frame in the Render View to allow scrolling through and review the animation results afterwards.
This blog describes how to add support for this feature to a 3rd party renderer.
Sequence Rendering Procedure
To add support for sequence rendering a procedure for this needs to be created and registered with Maya. This is a wrapper procedure written in MEL or Python, and it should in turn call the plugin render command to start the rendering. The following signature should be used for the procedure:
int mySequenceRenderProc(int width, int height, string camera, string saveToRenderView);
- width - The width of the images produced.
- height - The height of the images produced.
- camera - Sets the name of a specific camera to render. If set to empty string the renderer should iterate over all cameras that have been set as renderable.
- saveToRenderView - Sets the name of a camera for which the rendered images should be saved to the Render View. If set to empty string no images should be saved. If set to “all” images for all cameras should be saved. See below on how to save images to the render view.
The options sent in are set by Maya depending on user preferences. These options, and any custom options needed by the renderer, should be sent to the render command when it’s called from inside this wrapper procedure.
Maya will call this procedure to start the rendering for each render layer that has been selected for rendering. Maya will also handle execution of Pre/Post Render MEL scripts and Pre/Post Render Layer MEL scripts. The plugin render command should handle iteration over frames and cameras and also execute Pre/Post Render Frame scripts.
The frame range can be read from the common render globals:
MCommonRenderSettingsData renderGlobals; MRenderUtil::getCommonRenderSettings(renderGlobals); renderGlobals.frameStart renderGlobals.frameEnd renderGlobals.frameBy
Region rendering is supported. If this is requested by the user Maya will set the attribute defaultRenderGlobals.useRenderRegion to true.
Like with ordinary Render View rendering the execution should abort if the user presses the Esc key. If this happens the wrapper procedure should return a non-zero value to notify the render layer iteration on Maya side to abort.
Registration
The wrapper procedure is registered like all other renderer procedures using the MEL/Python command “renderer”. A new flag “-renderSequenceProcedure” has been added for this purpose.
Example - Register a new renderer supporting single frame rendering and sequence rendering:
renderer -rendererUIName "My Renderer" -renderProcedure "myRenderProc" -renderSequenceProcedure "mySequenceRenderProc" myRenderer;
Example – Add sequence rendering support to an already registered renderer:
renderer -edit -renderSequenceProcedure "mySequenceRenderProc" myRenderer;
Save to Render View
The following MEL code can be used by the plugin command to save the result in the Render View.
string $allPanels[0] = `getPanel -scriptType renderWindowPanel`; if (size($allPanels) > 0) { renderWindowMenuCommand "keepImageInRenderView" $allPanels[0]; }
Comments
You can follow this conversation by subscribing to the comment feed for this post.