I'm writing a multi-view synthetic dataset generator and I want to save my rendered images as multi-layer EXR. I have a basic Python script that loads a template file with the compositing nodes below, append an object and renders from different views by varying the camera position.
When I render a scene in Blender, I get the desired result: a multi-layer EXR image with denoised colors, raw normals and clipped depths. However, I cannot find a way to render to the File Output node in Python, since
scene.render.filepath is different than
nodes['File Output'].base_path. When I call
bpy.ops.render.render(write_still=True), I get a multi-layer EXR that essentially ignores my output node and just uses the value in Output Properties. This is true even if I remove the denoising node.
Is there any way to render through the File Output node in Python? Is my Composite node actually correct? I need compositing because I want to use the denoiser to reduce render times. Both
scene.render.use_compositing are set to True in my code.