I am currently writing a script that should render out each render layer via:


and then save the resulting image. The problem is that when I do:

bpy.data.images[“Render Result”].save_render(“InsertFilePathHere”,scene=bpy.data.scene[0])

and I have the scene file format set to OpenExr Multilayer, the image still only gets saved as a normal/flat openexr file. This is probably a bug right?

The even weirder thing is that then I open a OpenExr Multilayer file in Blender and then go:


python outputs : “’PNG”

Thanks in advance for any answers

  • $\begingroup$ Hello, is there any update on this ? If the question is unanswered, should I start a new one instead ? $\endgroup$ – Jonathan Chemla Sep 28 '15 at 8:18
  • $\begingroup$ hi jonathan, sorry for the late answer. I think the only workaround I found at that time is to write the image to disk while rendering: bpy.ops.render.render(write_still=True). I currently don't have the time to look into it further, sorry :( $\endgroup$ – Luca Scheller Oct 3 '15 at 14:48
  • $\begingroup$ No worries, I've found a workaround in Python as well : Use the File output Node, and addinputs if yo uneed a multilayer EXR. Adding this as a suggested answer. $\endgroup$ – Jonathan Chemla Oct 5 '15 at 6:57

You can add a File output Node, then add as many sockets as you need in your multilayer EXR, and connect them to your renderlayer sockets node:

renderlayers_node = scene_tree.nodes.new('CompositorNodeRLayers')
outputfile_node = scene_tree.nodes.new('CompositorNodeOutputFile')
outputfile_node.format.file_format = 'OPEN_EXR_MULTILAYER'  # 'OPEN_EXR'
outputfile_node.base_path = base_path
scene_tree.links.new(renderlayers_node.outputs['Image'], outputfile_node.inputs['Image'])
scene_tree.links.new(renderlayers_node.outputs['Z'], outputfile_node.inputs['Z'])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.