[Bf-blender-cvs] [50d5c03e2d1] master: UI: Use popup dialog for make single user from operator search

Campbell Barton noreply at git.blender.org
Tue Feb 11 04:11:08 CET 2020


Commit: 50d5c03e2d14b852c6afd3046aa8428bede85efd
Author: Campbell Barton
Date:   Tue Feb 11 14:01:01 2020 +1100
Branches: master
https://developer.blender.org/rB50d5c03e2d14b852c6afd3046aa8428bede85efd

UI: Use popup dialog for make single user from operator search

Use a popup since the default action was to do nothing,
the user would always need to access the redo panel.

Resolves T73711.

===================================================================

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

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 6ca6cb7b544..537a4a4761a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2713,6 +2713,7 @@ class VIEW3D_MT_make_single_user(Menu):
 
     def draw(self, _context):
         layout = self.layout
+        layout.operator_context = 'EXEC_DEFAULT'
 
         props = layout.operator("object.make_single_user", text="Object")
         props.object = True
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 687634801b3..8ee061efc08 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2645,8 +2645,11 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
   ot->description = "Make linked data local to each object";
   ot->idname = "OBJECT_OT_make_single_user";
 
+  /* Note that the invoke callback is only used from operator search,
+   * otherwise this does nothing by default. */
+
   /* api callbacks */
-  ot->invoke = WM_menu_invoke;
+  ot->invoke = WM_operator_props_popup_confirm;
   ot->exec = make_single_user_exec;
   ot->poll = ED_operator_objectmode;



More information about the Bf-blender-cvs mailing list