From 188f7585a1838387c278780d743e5540a0c75a2c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 19 Aug 2022 12:42:52 +0200 Subject: Fix T100323: Outliner: Do not allow to delete objects from an override collection. --- source/blender/editors/space_outliner/outliner_tools.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/editors/space_outliner') 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)) { -- cgit v1.2.3