From 40afb8ae6a036d904a10680530a89955248d0e06 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Oct 2022 11:29:47 +0200 Subject: Lib reload/relocate: Improve performances. Reduce amounts of viewlayer updates during remapping while relocating libraries. Gives some improvements on relocating process, depending on complexity of existing scene and reloaded libraries, whether there is liboverrides to resync, etc., can give up to 10% speedup. --- source/blender/blenkernel/intern/blendfile_link_append.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index a937c74578a..4dd225c09ec 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -1494,6 +1494,7 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, * code is wrong, we need to redo it here after adding them back to main. */ BKE_main_id_refcount_recompute(bmain, false); + BKE_layer_collection_resync_forbid(); /* Note that in reload case, we also want to replace indirect usages. */ const short remap_flags = ID_REMAP_SKIP_NEVER_NULL_USAGE | (do_reload ? 0 : ID_REMAP_SKIP_INDIRECT_USAGE); @@ -1523,6 +1524,8 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, id_us_plus_no_lib(&old_key->id); } } + BKE_layer_collection_resync_allow(); + BKE_main_collection_sync_remap(bmain); BKE_main_unlock(bmain); -- cgit v1.2.3