[Bf-blender-cvs] [188f7585a18] blender-v3.3-release: Fix T100323: Outliner: Do not allow to delete objects from an override collection.

Bastien Montagne noreply at git.blender.org
Fri Aug 19 12:59:22 CEST 2022


Commit: 188f7585a1838387c278780d743e5540a0c75a2c
Author: Bastien Montagne
Date:   Fri Aug 19 12:42:52 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB188f7585a1838387c278780d743e5540a0c75a2c

Fix T100323: Outliner: Do not allow to delete objects from an override collection.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 73c9ccca048..e5c417daa0d 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -2341,6 +2341,17 @@ static TreeTraversalAction outliner_find_objects_to_delete(TreeElement *te, void
     return TRAVERSE_SKIP_CHILDS;
   }
 
+  /* Do not allow to delete children objects of an override collection. */
+  TreeElement *te_parent = te->parent;
+  if (outliner_is_collection_tree_element(te_parent)) {
+    TreeStoreElem *tselem_parent = TREESTORE(te_parent);
+    ID *id_parent = tselem_parent->id;
+    BLI_assert(GS(id_parent->name) == ID_GR);
+    if (ID_IS_OVERRIDE_LIBRARY_REAL(id_parent)) {
+      return TRAVERSE_SKIP_CHILDS;
+    }
+  }
+
   ID *id = tselem->id;
 
   if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) {



More information about the Bf-blender-cvs mailing list