When I render via Blender, after rendering it's very easy for me to choose a different format and save it as that. Therefore I can get both Open EXR and PNG.

However, when rendering an animation, say via the command line, the entire reason I'm doing it on the command line is I'm using cloud compute.

I'd like to save time + money and not have to re-render the same animation in a different format. Is there a way to specify 2 formats without having to re-render? Maybe via a Python script or the command line?


1 Answer 1


Yes you can do that using the Compositor where you can specify multiple File Output Nodes. You can use this script which automatically creates this setup and renders the outputs to the path specified in the OUTPUT_PATH variable. You can also append more types in the OUTPUTS list variable within the script.

enter image description here

Just copy the script and paste in Text Editor and run script or save it as .py file and execute it in the command line or terminal.

import bpy

OUTPUT_PATH = "/path/to/output/directory/"
FILENAME = "my_file_name"

scene = bpy.context.scene
scene.render.use_compositing = True
scene.use_nodes = True
scene.render.filepath = OUTPUT_PATH + FILENAME

tree = scene.node_tree

def clear_nodes():
    for node in tree.nodes:

def create_output_node(name, render_node, location, type):
    node = tree.nodes.new(type='CompositorNodeOutputFile')
    node.name = name
    node.base_path = OUTPUT_PATH
    node.location = location
    node.format.file_format = type
    node.file_slots[0].path = FILENAME
    link = tree.links.new(render_node.outputs[0], node.inputs[0])

def create_nodes():
    comp_node = tree.nodes.new('CompositorNodeComposite')
    comp_node.location = 300,200
    render_node = tree.nodes.new('CompositorNodeRLayers')
    render_node.location = 0,0
    link = tree.links.new(render_node.outputs[0], comp_node.inputs[0])

    for i, type in enumerate(OUTPUTS):
        create_output_node("output_" + type, render_node, (300,-i*150), type)


#bpy.ops.render.render() #render single image
bpy.ops.render.render(animation=True, use_viewport=True)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .