diff options
-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)) { |