[Bf-blender-cvs] [40afb8ae6a0] master: Lib reload/relocate: Improve performances.

Bastien Montagne noreply at git.blender.org
Thu Oct 20 11:49:37 CEST 2022


Commit: 40afb8ae6a036d904a10680530a89955248d0e06
Author: Bastien Montagne
Date:   Thu Oct 20 11:29:47 2022 +0200
Branches: master
https://developer.blender.org/rB40afb8ae6a036d904a10680530a89955248d0e06

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.

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

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

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

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);



More information about the Bf-blender-cvs mailing list