get animation range from timeline and set it to ALL scenes in the file

I am trying to write a script that sets the animation range to the same values in all of the scenes in the blend file.
I want all of the scenes to have the exact same render settings, so I need a script that automatically sets them all.

Right now I am setting the animation range from within the script, but my true wish is to set it up once in my main scene and then when running the script, it should apply the main scene’s render settings to all of the other scenes.

Is this possible to do via python?
How can I get the animation range from timeline and set it to ALL scenes in the file?


import bpy

for scene in bpy.data.scenes:
    scene.frame_start = bpy.context.scene.frame_start
    scene.frame_end = bpy.context.scene.frame_end

Or something. This will set the start and end frames for all scenes to be the same as the currently selected one. Then just do the other settings the same way.

That did the trick! Thank you! :slight_smile: