I created a multichannel OpenEXR file by script, everything seems to be working well except for the fact that Blender does not save my file when rendering. This problem is specifically for the multichannel OpenEXR; if I create many simple (not multichannel) OpenEXR files they do get saved in the correct directory.
The node tree that is produced by my script looks like this:
And the relevant part of the script, that I use to set up part of this node tree:
def take_picture(index):
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
nodes = tree.nodes
links = tree.links
# create layer + metadata nodes
rl = nodes.new('CompositorNodeRLayers')
l_node = nodes.new('CompositorNodeValue')
l_node.label = 'Wavelength'
l_node.name = 'Lambda'
l_node.location = 300, 0
l_node.outputs['Value'].default_value = 5
# call output exr, create extra output slots
f = nodes.new('CompositorNodeOutputFile')
f.label = 'EXR Multichannel'
f.name = 'OutFile'
f.format.file_format = 'OPEN_EXR_MULTILAYER'
# If I cange this to 'OPEN_EXR', I do obtain my output files in the specified folder.
f.base_path = "//Rendered images/Test/Img"
f.file_slots.new('Lambda')
f.file_slots.new("image_" + index)
# Links
links.new(l_node.outputs['Value'], f.inputs['Lambda'])
links.new(rl.outputs['Image'], f.inputs['image_'+index])
# render
bpy.ops.render.render()
When I run this function for some index specified in my script, it works fine and all nodes are created the way I want them to be, but I don't get any output file..