Skip to content
Snippets Groups Projects
Commit 6298c51c authored by Campbell Barton's avatar Campbell Barton
Browse files

a bit nicer code for switching scenes

parent 022c9f91
Branches
Tags
No related merge requests found
......@@ -148,22 +148,24 @@ class AddSurroundScenesOperator(bpy.types.Operator):
return False
def execute(self, context):
scene_base = context.scene
numScreens = context.window_manager.previous_num_surround_screens
sceneName = context.scene.name
renderpath = context.scene.render.filepath
sceneName = scene_base.name
renderpath = scene_base.render.filepath
for i in range(0, numScreens):
thisScene = sceneName + "-Camera" + str(i)
bpy.ops.scene.new(type='LINK_OBJECTS')
context.scene.name = thisScene
scene_new = context.scene
scene_new.name = thisScene
context.scene.camera = bpy.data.objects["Camera" + str(i)]
scene_new.camera = bpy.data.objects["Camera" + str(i)]
context.scene.render.filepath = renderpath + thisScene
scene_new.render.filepath = renderpath + thisScene
context.screen.scene = bpy.data.scenes[sceneName]
context.screen.scene = scene_base
context.window_manager.surround_screens_init = True
return {'FINISHED'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment