[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43351] trunk/blender: adding metaballs and lamps in local mode was broken.

Campbell Barton ideasman42 at gmail.com
Fri Jan 13 11:14:51 CET 2012


Revision: 43351
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43351
Author:   campbellbarton
Date:     2012-01-13 10:14:48 +0000 (Fri, 13 Jan 2012)
Log Message:
-----------
adding metaballs and lamps in local mode was broken.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_info.py
    trunk/blender/source/blender/editors/object/object_add.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_info.py	2012-01-13 09:26:06 UTC (rev 43350)
+++ trunk/blender/release/scripts/startup/bl_ui/space_info.py	2012-01-13 10:14:48 UTC (rev 43351)
@@ -273,8 +273,10 @@
     def draw(self, context):
         layout = self.layout
 
-        layout.operator_context = 'EXEC_SCREEN'
+        # note, dont use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
 
+        layout.operator_context = 'EXEC_AREA'
+
         #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
         layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
 
@@ -296,7 +298,7 @@
         layout.separator()
 
         layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
-        layout.operator_context = 'EXEC_SCREEN'
+        layout.operator_context = 'EXEC_AREA'
         layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
         layout.separator()
 

Modified: trunk/blender/source/blender/editors/object/object_add.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_add.c	2012-01-13 09:26:06 UTC (rev 43350)
+++ trunk/blender/source/blender/editors/object/object_add.c	2012-01-13 10:14:48 UTC (rev 43351)
@@ -226,20 +226,18 @@
 		View3D *v3d = CTX_wm_view3d(C);
 		Scene *scene = CTX_data_scene(C);
 		int a, values[20], layer;
-		
+
 		if(v3d) {
 			layer = (v3d->scenelock && !v3d->localvd)? scene->layact: v3d->layact;
-
-			for(a=0; a<20; a++)
-				values[a]= (layer & (1<<a));
 		}
 		else {
 			layer = scene->layact;
+		}
 
-			for(a=0; a<20; a++)
-				values[a]= (layer & (1<<a));
+		for (a=0; a<20; a++) {
+			values[a]= (layer & (1<<a));
 		}
-		
+
 		RNA_boolean_set_array(op->ptr, "layers", values);
 	}
 }



More information about the Bf-blender-cvs mailing list