Save two outputs with command-line - or custom name in "Output file node"

I’m sorry if this is not the right place to post this, since it’s a question more than a discussion about developement,. But on other channels, such as blender stackexchange and blenderartists forum I got no response, so maybe my question needs a dev to be answered. Following copy-paste from BA

Hello everyone, there’s a problem I can’t solve. I’d be glad if the community can give me a hand.

I often do renders over night with a batch file (win8) using command line interface, and I like to choose EXR format to have 32bit files ready for archive. I also like to have blender saving the jpg preview to have a quick view in OS filebrowser (plus in the jpeg i can save metadata, such as rendertime and samples number, used for later debug).
But then, due to my company workflow, I have to go back into Blender and manually export the EXRs into 16bits TIFF files. This is quite annoying and time consuming (let alone that I’m the only one that can do that, so the tiff have to wait 9am when i get to work).

– The question is:

Is it possible to set 2 outputs (2 file formats) in the CLI?

if not:
I could turn on compositing and set a File Output node with desired format (TIFF in my case).
But now the problem is that the outputted file would be named “Image” and not as I set in the batch.

– So the 2nd question is:

Can the name of the Output file be changed to something dynamic (for example blend_file_name##) with drivers or python script? Notice that I already use a .py in the CLI to set some variables so I could add that easily (hopefully…)

Hoping my questions were clearly exposed, I’m looking forward for lots of replies with plenty of solutions :slight_smile:


Yes, you need a reference to the node, then you can get the list of file_slots.
The subpath attribute is called path:

Run “blender -h” from the command line and look at the Render and Format options.

Thank you @BYOB, and how can I get the filename via python, to put it in the path?

@stiv sure I know the commands, what I miss is if I can tell Blender to save the render twice. Afaict no, it’s not possible. I can put two -o (output) in the command line but this means render two times the file, which is not desiderable.

Why don’t you postprocess the images after rendering is done? Should be pretty forward with python and pillow - not sure if it handles exr out of the box.

You could also do the postprocessing through blender I guess, shouldn’t be too complicated to walk over the files and open and ‘save as tiff’ once rendering is completed.

This is not related to developing Blender it’s self and belongs to