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-10-20 12:29:47 +0300
committerBastien Montagne <bastien@blender.org>2022-10-20 12:39:59 +0300
commit40afb8ae6a036d904a10680530a89955248d0e06 (patch)
treeb33113c931c8fd41675783aa05634e101e8197e2
parentbd9d68e4dc6fcc840afa514cba7975a6bd86386d (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/blendfile_link_append.c3
1 files changed, 3 insertions, 0 deletions
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);