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-01-05 18:30:15 +0300
committerBastien Montagne <bastien@blender.org>2022-01-05 19:30:22 +0300
commitbfb760e16acbc33661739154f0ab8f5505987d1d (patch)
tree1058bb182647e3e5a364509e868344f419899e6b /source/blender/makesrna
parent1403f034ffd4b394fc8a9b8adec34698dcec891e (diff)
Fix T94650: LibOverride: Bad handling of (auto)resync in case of single override.
Overrides that are not created as part of an override hierarchy should not be handled through (auto)resync at all. users are responsible to hanlde those updates if they need it. This is achieved by flagging overrides created outside of a hierarchical process accordingly, and skipping them during resync process.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c8
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index be612a1602b..c43b80204cf 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -1808,6 +1808,14 @@ static void rna_def_ID_override_library(BlenderRNA *brna)
RNA_def_pointer(
srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
+ prop = RNA_def_boolean(srna,
+ "is_in_hierarchy",
+ true,
+ "Is In Hierarchy",
+ "Whether this library override is defined as part of a library "
+ "hierarchy, or as a single, isolated and autonomous override");
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY);
+
prop = RNA_def_collection(srna,
"properties",
"IDOverrideLibraryProperty",
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index 19c678a4222..2af83c8adcb 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -1095,6 +1095,13 @@ static void rna_property_override_check_resync(Main *bmain,
ID *id_src = rna_property_override_property_real_id_owner(bmain, ptr_item_src, NULL, NULL);
ID *id_dst = rna_property_override_property_real_id_owner(bmain, ptr_item_dst, NULL, NULL);
+ BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_owner));
+
+ /* If the owner ID is not part of an override hierarchy, there is no possible resync. */
+ if (id_owner->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) {
+ return;
+ }
+
/* If `id_src` is not a liboverride, we cannot perform any further 'need resync' checks from
* here. */
if (id_src != NULL && !ID_IS_OVERRIDE_LIBRARY_REAL(id_src)) {