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>2021-07-28 13:24:07 +0300
committerBastien Montagne <bastien@blender.org>2021-07-28 13:33:16 +0300
commit544ddcdaac20bab7707a49edbd31b8ae38446603 (patch)
treeb7e62ada006392f0507be854e9946266bfcaad73 /source/blender/blenkernel/intern/lib_override.c
parent91dd1a1ba398e81d5a9737969f5e8f64bba8eff5 (diff)
Fix (studio-reported) liboverride resync crash after recent changes.
Recent own rBabf3ce811f6e prevented any LayerCollection update during the whole liboverride resync process, for both performances and feature reasons. However that means that the various runtime caches like the Base GHash are not cleared anymore during ID remapping process, so we need to call `BKE_main_collection_sync_remap` instead of `BKE_main_collection_sync` when we finally are ready for this update. Reported by @eyecandy (Andy Goralczyk) from Blender studio, thanks!
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.c')
-rw-r--r--source/blender/blenkernel/intern/lib_override.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 8b63594955f..8e67547b719 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -772,7 +772,11 @@ static void lib_override_library_create_post_process(Main *bmain,
/* NOTE: We only care about local IDs here, if a linked object is not instantiated in any way we
* do not do anything about it. */
- BKE_main_collection_sync(bmain);
+ /* We need to use the `_remap` version here as we prevented any LayerCollection resync during the
+ * whole liboverride resyncing, which involves a lot of ID remapping.
+ *
+ * Otherwise, cached Base GHash e.g. can contain invalid stale data. */
+ BKE_main_collection_sync_remap(bmain);
/* We create a set of all objects referenced into the scene by its hierarchy of collections.
* NOTE: This is different that the list of bases, since objects in excluded collections etc.