diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-19 13:42:52 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-19 13:42:52 +0300 |
commit | 188f7585a1838387c278780d743e5540a0c75a2c (patch) | |
tree | 019a9ad88dcd2bfcb6bc2afb93481e5dd7552017 | |
parent | 5c9bea25d08ccdcac004d22046d0ca08ad3f462c (diff) |
Fix T100323: Outliner: Do not allow to delete objects from an override collection.
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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)) { |