[Bf-blender-cvs] [afa4f8f3ce0] blender-v3.3-release: LibOverride: Minor resync optimization by removing unuecessary processing.

Bastien Montagne noreply at git.blender.org
Tue Aug 30 15:18:22 CEST 2022


Commit: afa4f8f3ce0260262e98ee3804a7ae40d931e0d9
Author: Bastien Montagne
Date:   Tue Aug 30 15:17:16 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBafa4f8f3ce0260262e98ee3804a7ae40d931e0d9

LibOverride: Minor resync optimization by removing unuecessary processing.

Not much to gain here, but can make resync faster by a few percents when
dealing with linked overrides and such.

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

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

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

diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc
index 94642ad2116..29f8b26c296 100644
--- a/source/blender/blenkernel/intern/lib_override.cc
+++ b/source/blender/blenkernel/intern/lib_override.cc
@@ -1802,6 +1802,10 @@ static bool lib_override_library_resync(Main *bmain,
     lib_override_hierarchy_dependencies_recursive_tag(&data);
 
     FOREACH_MAIN_ID_BEGIN (bmain, id) {
+      if ((id->lib != id_root->lib) || !ID_IS_OVERRIDE_LIBRARY(id)) {
+        continue;
+      }
+
       /* IDs that get fully removed from linked data remain as local overrides (using place-holder
        * linked IDs as reference), but they are often not reachable from any current valid local
        * override hierarchy anymore. This will ensure they get properly deleted at the end of this
@@ -1815,10 +1819,6 @@ static bool lib_override_library_resync(Main *bmain,
         id->tag |= LIB_TAG_MISSING;
       }
 
-      if ((id->lib != id_root->lib) || !ID_IS_OVERRIDE_LIBRARY(id)) {
-        continue;
-      }
-
       /* While this should not happen in typical cases (and won't be properly supported here),
        * user is free to do all kind of very bad things, including having different local
        * overrides of a same linked ID in a same hierarchy. */
@@ -2401,6 +2401,11 @@ static void lib_override_library_main_resync_on_library_indirect_level(
     if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
       continue;
     }
+
+    if (!lib_override_resync_id_lib_level_is_valid(id, library_indirect_level, true)) {
+      continue;
+    }
+
     if (id->tag & (LIB_TAG_DOIT | LIB_TAG_MISSING)) {
       /* We already processed that ID as part of another ID's hierarchy. */
       continue;



More information about the Bf-blender-cvs mailing list