[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2637] contrib/py/scripts/addons/ space_view3d_add_surround_cameras.py: added Campbell' s background scene patch.

Cole Ingraham coledingraham at gmail.com
Sun Nov 20 19:27:23 CET 2011


Revision: 2637
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2637
Author:   coledingraham
Date:     2011-11-20 18:27:22 +0000 (Sun, 20 Nov 2011)
Log Message:
-----------
added Campbell's background scene patch. streamlined gui.

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-20 18:12:25 UTC (rev 2636)
+++ contrib/py/scripts/addons/space_view3d_add_surround_cameras.py	2011-11-20 18:27:22 UTC (rev 2637)
@@ -22,7 +22,7 @@
     'location': "View3D > Tool Shelf > Surround Projection panel",
     'description': "Setup cameras and create rendering scenes for n-screen surround projection.",
     'wiki_url': "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/3D_interaction/Surround_Projection_Tools",
-    'version': (0,1,1),
+    'version': (0,1,2),
     'blender': (2, 6, 0),
     'api': 41769,
     'category': '3D View'
@@ -65,15 +65,24 @@
         row = col.row()
         row.prop(context.window_manager, "num_surround_screens")
         row = col.row()
-        row.operator('objects.add_surround_cameras', icon='CAMERA_DATA')
+        
+        if context.window_manager.previous_num_surround_screens is not -1:
+             row.operator('objects.remove_surround_cameras', icon='X')
+        else:
+             row.operator('objects.add_surround_cameras', icon='CAMERA_DATA')
+        
         row = col.row()
-        row.operator('scene.add_linked_scenes_for_surround_cameras', icon='SCENE_DATA')
+        
+        if context.window_manager.surround_screens_init is True:
+             row.operator('objects.remove_linked_scenes_for_surround_cameras', icon='X')
+        else:
+             row.operator('scene.add_linked_scenes_for_surround_cameras', icon='SCENE_DATA')
 
-        col = layout.column(align=True)
-        row = col.row()
-        row.operator('objects.remove_surround_cameras', icon='X')
-        row = col.row()
-        row.operator('objects.remove_linked_scenes_for_surround_cameras', icon='X')
+        #col = layout.column(align=True)
+        #row = col.row()
+        #row.operator('objects.remove_surround_cameras', icon='X')
+        #row = col.row()
+        #row.operator('objects.remove_linked_scenes_for_surround_cameras', icon='X')
 
 
 # operator for adding cameras
@@ -157,11 +166,16 @@
 
             thisScene = sceneName + "-Camera" + str(i)
 
-            bpy.ops.scene.new(type='LINK_OBJECTS')
+            bpy.ops.scene.new(type='EMPTY')
             scene_new = context.scene
             scene_new.name = thisScene
 
-            scene_new.camera = bpy.data.objects["Camera" + str(i)]
+            camera_object = bpy.data.objects["Camera" + str(i)]
+            scene_new.camera = camera_object
+            scene_new.background_set = scene_base
+            
+            # not essential but nice to have the camera in the scene
+            scene_new.objects.link(camera_object)
 
             scene_new.render.filepath = renderpath + thisScene
 



More information about the Bf-extensions-cvs mailing list