[Bf-blender-cvs] [d5a88f9bf4f] master: Fix (unreported) over-resync from RNA detection code in linked cases.

Bastien Montagne noreply at git.blender.org
Thu Feb 10 17:14:17 CET 2022


Commit: d5a88f9bf4f0d73bd8ee9f68ad4146260f7d559b
Author: Bastien Montagne
Date:   Thu Feb 10 16:58:22 2022 +0100
Branches: master
https://developer.blender.org/rBd5a88f9bf4f0d73bd8ee9f68ad4146260f7d559b

Fix (unreported) over-resync from RNA detection code in linked cases.

While applying liboverrides on linked data, RNA code (in
`rna_property_override_check_resync`) would detect a lot of false positive
regarding IDs needing resync, because the temporary ID used to apply
overrides was always local, breaking the libraries comparison check.

NOTE: that whole 'apply liboverrides' code could use some refreshment,
it did not change much from initila version several years ago, we now
have better tools and control over non-main data.

But for now the 'trick' in that commit should do the job, ultimately
those temps IDs should never be put in Main at all.

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

M	source/blender/blenkernel/intern/lib_override.c

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

diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 961f63b1f82..049b5e75c89 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -2997,6 +2997,8 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
     return;
   }
 
+  tmp_id->lib = local->lib;
+
   /* This ID name is problematic, since it is an 'rna name property' it should not be editable or
    * different from reference linked ID. But local ID names need to be unique in a given type
    * list of Main, so we cannot always keep it identical, which is why we need this special
@@ -3009,6 +3011,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
   Key *tmp_key = BKE_key_from_id(tmp_id);
   if (local_key != NULL && tmp_key != NULL) {
     tmp_key->id.flag |= (local_key->id.flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE);
+    tmp_key->id.lib = local_key->id.lib;
   }
 
   PointerRNA rnaptr_src, rnaptr_dst, rnaptr_storage_stack, *rnaptr_storage = NULL;



More information about the Bf-blender-cvs mailing list