I am trying to generate a python script for rendering RGB and/or an EXR file(for getting the mist pass) for spherical images using blender.

So I have a scene and I am using the cycles rendering engine. I want to save the OpenExr file and/or the RGB file based on the input that the user gives (for which I am using a JSON file).

For the mist pass I am using a setup similar to the following link: Getting the depth of every pixel to the center of projection of the camera in Blender

I am using the following lines of code for creating and saving the renders.


However, the above lines of code save both the RGB image as well as the EXR file. In order to render just the RGB images I have used the following in addition to the above lines of code and that works well:

bpy.context.scene.use_nodes = False

However, I am not able to generate just the OpenEXR file. Simply using the following also didn't help :


Can someone guide me with this and/or suggest a better way for the same?

  • $\begingroup$ Unfortunately there is no way to disable the default output (if that's your question) -> Disable default animation output when using "File output" nodes. $\endgroup$
    – brockmann
    Oct 19, 2021 at 11:26
  • $\begingroup$ Ohh ... that's bad. Anyway, thank you for your help. $\endgroup$
    – Sourabh
    Oct 19, 2021 at 12:45
  • $\begingroup$ No problem @Sourabh. Suggest set the default output to jpg and remove the file if necessary using python. $\endgroup$
    – brockmann
    Oct 19, 2021 at 13:51
  • $\begingroup$ what happens if you set the File Output node's path to the name of the exr file? 2 files, an error, or just 1? $\endgroup$ Oct 20, 2021 at 20:17


Your Answer

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

Browse other questions tagged or ask your own question.