2
$\begingroup$

I'm trying to make use of a python script that will render out all scenes and save the output according to each scene's render settings. I have a blender file with about 80 scenes. The original author of this post (https://forums.creativecow.net/thread/287/190) cited a way to accomplish this but the API has changed. When I run the below two lines I get this error

'RenderSettings' object has no attribute 'RenderAnim'

for s in bpy.data.scenes:
    s.render.renderAnim()

How can I accomplish this in Blender 2.76b? Specifically, how can I render all scenes in a single blend so that each scene saves the output according to each scene's saved render settings?

$\endgroup$
0

2 Answers 2

2
$\begingroup$

you just loop through the scenes and execute the render operator :

import bpy

for s in bpy.data.scenes :
    bpy.context.screen.scene = s   #set as the active scene
    bpy.ops.render.render(animation = True) #render animation
    #bpy.ops.render.render()  # for still render
$\endgroup$
0
0
$\begingroup$

This is what worked for me in Blender 3.5:

ctx = bpy.context.copy()
my_scene = MY_SCENE_NAME

bpy.ops.render.render('INVOKE_DEFAULT')

for s in bpy.data.scenes:
     if s == my_scene:
         ctx['window'].scene = s

Found here: How to set bpy.context.window.scene in the right context?

$\endgroup$

You must log in to answer this question.

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