LibOverride: Tweak RNA 'need resync' detection code.

* Assert about source ID of an overridden pointer property not being a
  liboverride was not necessary, just skip in that case.
* Tag actual 'real' ID owner for resync, and not (potentially) an embedded one.
This commit is contained in:
Bastien Montagne 2021-12-28 12:33:35 +01:00
parent 44db9f192e
commit 23ac79f2c2
1 changed files with 4 additions and 4 deletions

View File

@ -1095,8 +1095,8 @@ 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_src == NULL || ID_IS_OVERRIDE_LIBRARY_REAL(id_src));
/* Work around file corruption on writing, see T86853. */
/* 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)) {
return;
}
@ -1117,8 +1117,8 @@ static void rna_property_override_check_resync(Main *bmain,
* override copy generated by `BKE_lib_override_library_update` will already have its
* self-references updated to itself, instead of still pointing to its linked source. */
(id_dst->lib == id_src->lib && id_dst != id_owner))) {
ptr_dst->owner_id->tag |= LIB_TAG_LIB_OVERRIDE_NEED_RESYNC;
CLOG_INFO(&LOG, 3, "Local override %s detected as needing resync", ptr_dst->owner_id->name);
id_owner->tag |= LIB_TAG_LIB_OVERRIDE_NEED_RESYNC;
CLOG_INFO(&LOG, 3, "Local override %s detected as needing resync", id_owner->name);
}
}