3D View: correct menu for moving out of local-view
authorCampbell Barton <ideasman42@gmail.com>
Thu, 25 Feb 2016 09:36:06 +0000 (20:36 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 25 Feb 2016 09:38:06 +0000 (20:38 +1100)
Also name more clearly

release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/object/object_relations.c

index b11e1ddf00801843d2d3f3285cf525f97b0574e6..f38c0d50fb74e31903e698d0e98fcab3c5e73ca2 100644 (file)
@@ -1226,6 +1226,8 @@ class VIEW3D_MT_object(Menu):
 
     def draw(self, context):
         layout = self.layout
+        view = context.space_data
+        is_local_view = (view.local_view is not None)
 
         layout.operator("ed.undo")
         layout.operator("ed.redo")
@@ -1277,7 +1279,13 @@ class VIEW3D_MT_object(Menu):
 
         layout.separator()
 
-        layout.operator("object.move_to_layer", text="Move to Layer...")
+        if is_local_view:
+            layout.operator_context = 'EXEC_REGION_WIN'
+            layout.operator("object.move_to_layer", text="Move out of Local View")
+            layout.operator_context = 'INVOKE_REGION_WIN'
+        else:
+            layout.operator("object.move_to_layer", text="Move to Layer...")
+
         layout.menu("VIEW3D_MT_object_showhide")
 
         layout.operator_menu_enum("object.convert", "target")
index 41b9c95bc779f92c92ba018db242f8bd6183dac4..1a3209a8ca87592f3cc96766d55c95391a4897ca 100644 (file)
@@ -1338,7 +1338,7 @@ static int move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *even
 {
        View3D *v3d = CTX_wm_view3d(C);
        if (v3d && v3d->localvd) {
-               return WM_operator_confirm_message(C, op, "Move from localview");
+               return WM_operator_confirm_message(C, op, "Move out of Local View");
        }
        else {
                move_to_layer_init(C, op);