Q100091: Rendering multiple frames in Katana

Follow

SUMMARY

This article describes how to render multiple frames in Katana via Python.
 

MORE INFORMATION

Rendering multiple frames within the Katana UI is not currently supported and the recommended workflow for this is rendering in batch mode. Within a batch render command you can use the '-t' argument to specify the frame rage for your project render.

That being said, it is currently possible to trigger a render within the Katana UI via Python. This can be done using the following example on an existing project or using the KatanaFile.Load(yourKatanaScene) command to load the project as part of the Python execution:

import NodegraphAPI
from Katana import KatanaFile
from Katana import RenderManager
def messageHandler( sequenceID, message ):
  print message

RenderNode = NodegraphAPI.GetNode('Render') # Getting Render node
renderSettings = RenderManager.RenderingSettings()
renderSettings.frame=1
renderSettings.mode=RenderManager.RenderModes.DISK_RENDER
renderSettings.asynchRenderMessageCB=messageHandler
renderSettings.asynch=False
RenderManager.StartRender('diskRender', node=RenderNode, settings=renderSettings)

The StartRender command only supports rendering one frame at a time, however, you can render multiple frames by iterating through your frame range and executing new StartRender commands each time. This allows you to render the full desired frame range in UI mode.

To do this you need to replace the following command

RenderManager.StartRender('diskRender', node=RenderNode, settings=renderSettings)
with a loop through command like:

for frame in range(1, 6):
    print '-' * 80
    print '\nRendering Node '%s' frame %s...' % (RenderNode.getName(), frame)
    renderSettings.frame = frame
    RenderManager.StartRender('diskRender', node=RenderNode, settings=renderSettings)

 

NOTE:  If you are looking to modify the Katana project before launching your render in 'batch' mode, then you can use the above information to create a Python script that you would launch Katana with, via 'script' mode.

Was this article helpful?
2 out of 2 found this helpful