katana默认功能只能渲染单帧,但是有时候我们就需要渲染序列帧。这就需要进行脚本工具的开发,下面我就介绍一下如何编写渲染脚本。示例代码如下:
from Katana import NodegraphAPI, KatanaFile, RenderManager
def messageHandler(sequenceID, message):
print message
render_node_name = "Render" # 渲染节点的名称
render_start_frame = 1 #渲染开始帧
render_end_frame = 6 #渲染结束帧
render_by_frame = 1 #每隔多少帧渲染
render_node = NodegraphAPI.GetNode(render_node_name)
render_settings = RenderManager.RenderingSettings()
render_settings.frame=1
render_settings.mode=RenderManager.RenderModes.DISK_RENDER
render_settings.asynchRenderMessageCB=messageHandler
render_settings.asynch=False
RenderManager.StartRender('diskRender', node=RenderNode, settings=renderSettings)
for frame in xrange(render_start_frame, render_end_frame, render_by_frame):
renderSettings.frame = frame
RenderManager.StartRender('diskRender', node=RenderNode, settings=renderSettings)
以上示例代码放在katana python脚本编辑器里面设置好帧范围和需要渲染的节点就可以进行渲染了。欢迎各位大佬提出不同意见