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-08-31 13:36:54 +0300
committerBastien Montagne <bastien@blender.org>2022-08-31 13:36:54 +0300
commitd210ab90d4b7b0d2ce472493a697b1e868e36e78 (patch)
treed8be41574f1321cb75fc97b4979f8933c7be8b51
parent6177d9f0c8981837491f5153e3aab4ec0d04db44 (diff)
Fix crash in liboverride operations from the Outliner.
Checks for 'invalid' selected IDs that need to be skipped were incomplete, and one was missing the actual return statement.
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index d6305c836ff..847b9e0963b 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -1274,7 +1274,7 @@ static void id_override_library_reset_fn(bContext *C,
OutlinerLibOverrideData *data = reinterpret_cast<OutlinerLibOverrideData *>(user_data);
const bool do_hierarchy = data->do_hierarchy;
- if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) {
+ if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) {
CLOG_WARN(&LOG, "Could not reset library override of data block '%s'", id_root->name);
return;
}
@@ -1302,7 +1302,7 @@ static void id_override_library_clear_single_fn(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
ID *id = tselem->id;
- if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
+ if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) {
BKE_reportf(reports,
RPT_WARNING,
"Cannot clear embedded library override id '%s', only overrides of real "
@@ -1350,8 +1350,9 @@ static void id_override_library_resync_fn(bContext *UNUSED(C),
ID *id_root = tselem->id;
OutlinerLibOverrideData *data = reinterpret_cast<OutlinerLibOverrideData *>(user_data);
- if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) {
+ if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) {
CLOG_WARN(&LOG, "Could not resync library override of data block '%s'", id_root->name);
+ return;
}
if (id_root->override_library->hierarchy_root != nullptr) {
@@ -1399,7 +1400,7 @@ static void id_override_library_delete_hierarchy_fn(bContext *UNUSED(C),
BLI_assert(TSE_IS_REAL_ID(tselem));
ID *id_root = tselem->id;
- if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) {
+ if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) {
CLOG_WARN(&LOG, "Could not delete library override of data block '%s'", id_root->name);
return;
}