[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2619] contrib/py/scripts/addons/ space_view3d_add_surround_cameras.py: a bit nicer code for switching scenes
Campbell Barton
ideasman42 at gmail.com
Thu Nov 17 06:54:44 CET 2011
Revision: 2619
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2619
Author: campbellbarton
Date: 2011-11-17 05:54:42 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
a bit nicer code for switching scenes
Modified Paths:
--------------
contrib/py/scripts/addons/space_view3d_add_surround_cameras.py
Modified: contrib/py/scripts/addons/space_view3d_add_surround_cameras.py
===================================================================
--- contrib/py/scripts/addons/space_view3d_add_surround_cameras.py 2011-11-17 05:13:19 UTC (rev 2618)
+++ contrib/py/scripts/addons/space_view3d_add_surround_cameras.py 2011-11-17 05:54:42 UTC (rev 2619)
@@ -148,22 +148,24 @@
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'}
More information about the Bf-extensions-cvs
mailing list