4
$\begingroup$

I have a file with about 40 scenes, now I need to change the output settings, the format resolution, the frame rate, the output format ... etc.
Is there a way to copy the Output Properties from one scene to another, or all other scenes? So I can only change the destination folder for each scene manually?
I tried Copy Render Settings add-on, I just couldn't use it, it's either not working, or I really don't get how it works.

$\endgroup$

3 Answers 3

3
$\begingroup$

This should copy pretty much all properties from the current scene render settings to all the other scenes in the file :

import bpy

render = bpy.context.scene.render

def copy_struct(source, target):
    if not source or not target:
        return
    for name, prop in source.bl_rna.properties.items():
        if name == "rna_type":
            continue
        try:
            setattr(target, name, getattr(source, name))
        except AttributeError:
            new_source = getattr(source, name)
            new_target = getattr(target, name)
            if hasattr(new_source, "bl_rna"):
                copy_struct(new_source, new_target)
        except TypeError:
            pass

for scene in bpy.data.scenes:
    if scene == bpy.context.scene:
        continue
    render_current = scene.render        
    copy_struct(render, render_current)

I had a funky error with a stereoscopic property so you shouldn't use it if you're using stereoscopic camera in your scene.

I'd advise saving your file beforehand because this is a bulldozer approach and might break some settings... Prefer the other answer if you want more targeted properties to be copied over.

$\endgroup$
2
  • $\begingroup$ Thank you for your answer, this is exactly what I was looking for! $\endgroup$
    – Georges D
    Feb 3, 2022 at 8:22
  • $\begingroup$ I extended the script to use each scene's name as the output file name, I posted the edited script as a separate answer below. $\endgroup$
    – Georges D
    Feb 24, 2022 at 10:40
5
$\begingroup$

You can do this by simple script like this:

import bpy

current = bpy.context.scene

for s in bpy.data.scenes:
    s.render.filepath = current.render.filepath

If you run it from a text editor, it will copy the output path from the current scene to others.

render.filepath you can get by enabling developer extracts in user settings and then clicking on property that you want to copy and select in context menu "Copy data path". So, to copy frame rate get data path and add line like this with same indent:

for s in bpy.data.scenes:
    ...
    s.render.fps = current.render.fps
$\endgroup$
1
$\begingroup$

For this question, the accepted answer posted by Gorgious was exactly what I was looking for, however, later on, I extended the functionality of his script to use each scene's name as the output file name, rather than copying the file name of the current scene to all other scenes, if this is the case for you, use the edited script below:

import bpy
# importing os is part of the edited script
import os

render = bpy.context.scene.render

def copy_struct(source, target):
    if not source or not target:
        return
    for name, prop in source.bl_rna.properties.items():
        if name == "rna_type":
            continue
        try:
            setattr(target, name, getattr(source, name))
        except AttributeError:
            new_source = getattr(source, name)
            new_target = getattr(target, name)
            if hasattr(new_source, "bl_rna"):
                copy_struct(new_source, new_target)
        except TypeError:
            pass

for scene in bpy.data.scenes:
    if scene == bpy.context.scene:
        continue
    render_current = scene.render        
    copy_struct(render, render_current)
    # The following lines are part of the edited script
    # Change .png in the third line below to the file type extension you're using
    scn_name = scene.name
    output_path = scene.render.filepath.rsplit("/", 1)[0]
    scene.render.filepath = os.path.join(output_path, scn_name + ".png")
$\endgroup$

You must log in to answer this question.

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