0
$\begingroup$

In one scene I have two seperate FileOutputNodes and I want different color depths and file formats for each.

In the Blender GUI this is simple. You can press a FileOutputNode, then press N. Then the Properties panel shows and you can change the image settings for each node.

How do I do the same through the python API? I tried creating seperate bpy.types.ImageFormatSettings for each node, but unfortunately that attribute is read-only.


In particular, I want one node to have Open_EXR, 16-bit RGB; the other PNG 8-bit RGB.

I know I can create two seperate scenes and set the image settings for each scene, but I'd rather have one scene (because that's less code).

$\endgroup$
0
$\begingroup$

You can actually set the settings for each individual node.

Create your node:

file_output_node = tree.nodes.new('CompositorNodeOutputFile')

Then you can set your settings for this node by going into the format attribute. For example:

file_output_node.format.file_format = "PNG" # default is "PNG"
file_output_node.format.color_mode = "RGB"  # default is "BW"
file_output_node.format.color_depth = "16"  # default is 8
file_output_node.format.compression = 0     # default is 15
$\endgroup$

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.