[Bf-blender-cvs] [d210ab90d4b] blender-v3.3-release: Fix crash in liboverride operations from the Outliner.

Bastien Montagne noreply at git.blender.org
Wed Aug 31 12:38:00 CEST 2022


Commit: d210ab90d4b7b0d2ce472493a697b1e868e36e78
Author: Bastien Montagne
Date:   Wed Aug 31 12:36:54 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBd210ab90d4b7b0d2ce472493a697b1e868e36e78

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.

===================================================================

M	source/blender/editors/space_outliner/outliner_tools.cc

===================================================================

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;
   }



More information about the Bf-blender-cvs mailing list