[Bf-blender-cvs] [2bd85d9cc62] blender-v2.93-release: LibOverride: Fix many 'obsolete' overrides not being properly deleted.

Bastien Montagne noreply at git.blender.org
Fri May 7 12:54:08 CEST 2021


Commit: 2bd85d9cc6232c6fb44c8a2ceb50f45ad90ad66c
Author: Bastien Montagne
Date:   Fri May 7 12:52:34 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB2bd85d9cc6232c6fb44c8a2ceb50f45ad90ad66c

LibOverride: Fix many 'obsolete' overrides not being properly deleted.

Code detecting overrides which reference linked data is missing was
actually missing many cases, leading to too much garbage data being kept
around after resync process.

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

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

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

diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 6c94eda2ee0..a6bb8684864 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -902,6 +902,15 @@ bool BKE_lib_override_library_resync(Main *bmain,
       BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__);
   ID *id;
   FOREACH_MAIN_ID_BEGIN (bmain, id) {
+    /* 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
+     * function. */
+    if (!ID_IS_LINKED(id) && ID_IS_OVERRIDE_LIBRARY_REAL(id) &&
+        (id->override_library->reference->tag & LIB_TAG_MISSING) != 0) {
+      id->tag |= LIB_TAG_MISSING;
+    }
+
     if (id->tag & LIB_TAG_DOIT && !ID_IS_LINKED(id) && ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
       /* 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



More information about the Bf-blender-cvs mailing list