[Bf-blender-cvs] [f783efd1279] master: Fix T51680: 'Delete Group' from Group view of Outliner does not work.

Bastien Montagne noreply at git.blender.org
Wed May 31 21:17:42 CEST 2017


Commit: f783efd1279ae6c0e334e4fa86666e4f1234f85d
Author: Bastien Montagne
Date:   Wed May 31 21:14:08 2017 +0200
Branches: master
https://developer.blender.org/rBf783efd1279ae6c0e334e4fa86666e4f1234f85d

Fix T51680: 'Delete Group' from Group view of Outliner does not work.

Do not call invoke ops from outliner's operations menus. Invoke op would
search again for item under mouse coordinates... when it is invoked!
Means often entry menu you would have clicked would not be over target
item, leading to either nothing or operation being applied to wrong item.

Note: about groups, there is another minor annoyance leading to some
assert - groups have an annoying virtual fake user which breaks
usercount, will see whether this is easily fixable. :|

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

M	source/blender/editors/space_outliner/outliner_tools.c

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

diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index cdb3df0fae9..d1392b6c07e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -399,7 +399,7 @@ static void object_deselect_cb(
 
 static void object_delete_cb(
         bContext *C, ReportList *reports, Scene *scene, TreeElement *te,
-        TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
+        TreeStoreElem *tsep, TreeStoreElem *tselem, void *user_data)
 {
 	Base *base = (Base *)te->directdata;
 	
@@ -436,7 +436,7 @@ static void object_delete_cb(
 		 * Should not happen ideally, but does happens, see T51625.
 		 * Rather than twisting in all kind of ways to address all possible cases leading to that situation, simpler
 		 * to allow deleting such object as a mere generic data-block. */
-		WM_operator_name_call(C, "OUTLINER_OT_id_delete", WM_OP_INVOKE_REGION_WIN, NULL);
+		id_delete_cb(C, reports, scene, te, tsep, tselem, user_data);
 	}
 }
 
@@ -1058,7 +1058,7 @@ static EnumPropertyItem prop_group_op_types[] = {
 	{OL_GROUPOP_UNLINK, "UNLINK",     0, "Unlink Group", ""},
 	{OL_GROUPOP_LOCAL, "LOCAL",       0, "Make Local Group", ""},
 	{OL_GROUPOP_LINK, "LINK",         0, "Link Group Objects to Scene", ""},
-	{OL_GROUPOP_DELETE, "DELETE",     0, "Delete Group", "WARNING: no undo"},
+	{OL_GROUPOP_DELETE, "DELETE",     0, "Delete Group", ""},
 	{OL_GROUPOP_REMAP, "REMAP",       0, "Remap Users",
 	 "Make all users of selected data-blocks to use instead current (clicked) one"},
 	{OL_GROUPOP_INSTANCE, "INSTANCE", 0, "Instance Groups in Scene", ""},
@@ -1097,7 +1097,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op)
 			DAG_relations_tag_update(CTX_data_main(C));
 			break;
 		case OL_GROUPOP_DELETE:
-			WM_operator_name_call(C, "OUTLINER_OT_id_delete", WM_OP_INVOKE_REGION_WIN, NULL);
+			outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_delete_cb, NULL);
 			break;
 		case OL_GROUPOP_REMAP:
 			outliner_do_libdata_operation(C, op->reports, scene, soops, &soops->tree, id_remap_cb, NULL);




More information about the Bf-blender-cvs mailing list