Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-03-24 13:59:41 +0300
committerBastien Montagne <bastien@blender.org>2022-03-24 14:01:48 +0300
commit4a674d08dda82bddb461101adfe789272109141f (patch)
treee96bb42e9912b97e87a618857776b0155e63ede2 /source/blender/editors/space_outliner/outliner_edit.cc
parent24c30e001f6ec80215a8eaa3341f260168dfdca8 (diff)
Outliner: tweak handling of liboverrides in delete code.
Essentially, we only allow deletion of hierarchy roots of liboverrides, when hierarchy deletion option is enabled. Also add some checking code in the generic, non-object/collection ID delete code, to prevent any deletion of liboverrides that would be part of a hierarchy.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_edit.cc')
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc
index a60e082f6a5..ae67e7108bf 100644
--- a/source/blender/editors/space_outliner/outliner_edit.cc
+++ b/source/blender/editors/space_outliner/outliner_edit.cc
@@ -447,6 +447,17 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto
(tselem->type == TSE_LAYER_COLLECTION));
UNUSED_VARS_NDEBUG(te);
+ if (ID_IS_OVERRIDE_LIBRARY(id)) {
+ if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) ||
+ (id->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) == 0) {
+ BKE_reportf(reports,
+ RPT_WARNING,
+ "Cannot delete library override id '%s', it is part of an override hierarchy",
+ id->name);
+ return;
+ }
+ }
+
if (te->idcode == ID_LI && ((Library *)id)->parent != nullptr) {
BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked library '%s'", id->name);
return;