[Bf-blender-cvs] [62f238a65e3] master: Outliner: Allow deleting entire selection

Nathan Craddock noreply at git.blender.org
Sat Mar 7 22:47:10 CET 2020


Commit: 62f238a65e334ccecae85134da0b05ba58382ae9
Author: Nathan Craddock
Date:   Sat Mar 7 14:46:22 2020 -0700
Branches: master
https://developer.blender.org/rB62f238a65e334ccecae85134da0b05ba58382ae9

Outliner: Allow deleting entire selection

This allows deleting both collections and objects in the outliner
selection at the same time. This only works using the keyboard shortcuts
(X or Delete).

While this works, a more robust solution should be implemented later to
allow deleting the whole selection from the context menu as well.

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

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	source/blender/editors/space_outliner/outliner_collections.c

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 5aff2a75e03..15e434f2de9 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -787,6 +787,8 @@ def km_outliner(params):
         ("outliner.collection_new", {"type": 'C', "value": 'PRESS'}, None),
         ("outliner.collection_delete", {"type": 'X', "value": 'PRESS'}, None),
         ("outliner.collection_delete", {"type": 'DEL', "value": 'PRESS'}, None),
+        ("outliner.object_operation", {"type": 'X', "value": 'PRESS'}, {"properties": [("type", 'DELETE')]}),
+        ("outliner.object_operation", {"type": 'DEL', "value": 'PRESS'}, {"properties": [("type", 'DELETE')]}),
         ("object.move_to_collection", {"type": 'M', "value": 'PRESS'}, None),
         ("object.link_to_collection", {"type": 'M', "value": 'PRESS', "shift": True}, None),
         ("outliner.collection_exclude_set", {"type": 'E', "value": 'PRESS'}, None),
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index f129bc9e2ea..1aee8c20cbc 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -346,7 +346,9 @@ static int collection_delete_exec(bContext *C, wmOperator *op)
     WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active);
   }
 
-  return OPERATOR_FINISHED;
+  /* Temporary fix to allow deleting both collections and objects at the same time
+   * using the same key mapping. */
+  return OPERATOR_PASS_THROUGH;
 }
 
 void OUTLINER_OT_collection_delete(wmOperatorType *ot)



More information about the Bf-blender-cvs mailing list