I need to script some render workflows and therefore I also need to save the z-values for each rendered camera perspective. I know how to do it using the node editor manually, but I really struggle doing it in python. I guess the only thing is to setup a "Render Layer", a "Composite" and an additional "File Output Node" but I can't find any useful examples or tutorials. I found a few things how to create a node but these examples seems to be old and doesn't work on 2.68.
i.e. this doesn't work anymore:
Code: Select all
# switch on nodes bpy.context.scene.use_nodes = True tree = bpy.context.scene.node_tree # clear default nodes for n in tree.nodes: tree.nodes.remove(n) # create input render layer node rl = tree.nodes.new('R_LAYERS') Traceback (most recent call last): File "<blender_console>", line 1, in <module> RuntimeError: Error: Node type R_LAYERS undefined
Each hint that helps me would be very nice.