diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-30 16:17:16 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-30 16:18:17 +0300 |
commit | afa4f8f3ce0260262e98ee3804a7ae40d931e0d9 (patch) | |
tree | 646129118d979f5158ec10e94796f53db080de2c /source/blender | |
parent | 34ff27025d442f6b5e65075e8c8b6aaad8e400b4 (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.cc | 13 |
1 files changed, 9 insertions, 4 deletions
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; |