[Bf-blender-cvs] [c37b8372449] blender-v3.1-release: Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.

Bastien Montagne noreply at git.blender.org
Fri Jan 28 10:53:59 CET 2022


Commit: c37b83724494c4a69db712a4d149a6b1ade61d51
Author: Bastien Montagne
Date:   Fri Jan 28 10:22:25 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBc37b83724494c4a69db712a4d149a6b1ade61d51

Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.

In Outliner, 'Make Override Hierarchy' on an indirectly linked data would
fail in case some items higher up in the hierarchy also needed to be
overridden was also indirectly linked.

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

M	source/blender/editors/space_outliner/outliner_tools.cc
M	source/blender/makesdna/DNA_ID.h

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

diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index fa31025b550..03fc4c20fe5 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -859,8 +859,9 @@ static void id_override_library_create_fn(bContext *C,
         if (!ID_IS_LINKED(te->store_elem->id)) {
           break;
         }
-        /* If we'd need to override that aren't ID, but it is not overridable, abort. */
-        if (!ID_IS_OVERRIDABLE_LIBRARY(te->store_elem->id)) {
+        /* If some element in the tree needs to be overridden, but its ID is not overridable,
+         * abort. */
+        if (!ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(te->store_elem->id)) {
           BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
           BKE_reportf(reports,
                       RPT_WARNING,
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 060b55ffe5c..fad24f4326c 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -534,12 +534,14 @@ typedef struct PreviewImage {
 
 #define ID_IS_LINKED(_id) (((const ID *)(_id))->lib != NULL)
 
-/* Note that this is a fairly high-level check, should be used at user interaction level, not in
+/* Note that these are fairly high-level checks, should be used at user interaction level, not in
  * BKE_library_override typically (especially due to the check on LIB_TAG_EXTERN). */
-#define ID_IS_OVERRIDABLE_LIBRARY(_id) \
-  (ID_IS_LINKED(_id) && !ID_MISSING(_id) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0 && \
+#define ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(_id) \
+  (ID_IS_LINKED(_id) && !ID_MISSING(_id) && \
    (BKE_idtype_get_info_from_id((const ID *)(_id))->flags & IDTYPE_FLAGS_NO_LIBLINKING) == 0 && \
    !ELEM(GS(((ID *)(_id))->name), ID_SCE))
+#define ID_IS_OVERRIDABLE_LIBRARY(_id) \
+  (ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY((_id)) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0)
 
 /* NOTE: The three checks below do not take into account whether given ID is linked or not (when
  * chaining overrides over several libraries). User must ensure the ID is not linked itself



More information about the Bf-blender-cvs mailing list