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>2021-05-06 19:33:42 +0300
committerBastien Montagne <bastien@blender.org>2021-05-07 13:54:13 +0300
commitaa8e058a596abd30d75987ca2cc11d8f8806512f (patch)
tree98d0f98ed1bcea2e834f7b185c5d92a404171622 /source/blender/blenkernel/intern/lib_override.c
parent23acca0c32027e41a1f6707a896b711aecedc8cd (diff)
LibOverride: Do not preserve local overrides when their linked data disappear.
This is the opposite of previous code, which would keep those 'deprecated' overrides arround (often in a dedicated collection), when they were detected as user-edited. While this is a safe-ish way to (try to) preserve user-edited data, this tends to add too much 'trash' data to production scenes, which cleaning becomes a burden. Note that user will get warnings in thos cases, and can always choose not to save the current blend file and go fix the library issue instead.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.c')
-rw-r--r--source/blender/blenkernel/intern/lib_override.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 6c94eda2ee0..5bcd5338f8f 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1068,6 +1068,7 @@ bool BKE_lib_override_library_resync(Main *bmain,
id->tag &= ~LIB_TAG_MISSING;
CLOG_INFO(&LOG, 2, "Old override %s is being deleted", id->name);
}
+#if 0
else {
/* Otherwise, keep them, user needs to decide whether what to do with them. */
BLI_assert((id->tag & LIB_TAG_DOIT) == 0);
@@ -1075,6 +1076,16 @@ bool BKE_lib_override_library_resync(Main *bmain,
id->flag |= LIB_LIB_OVERRIDE_RESYNC_LEFTOVER;
CLOG_INFO(&LOG, 2, "Old override %s is being kept around as it was user-edited", id->name);
}
+#else
+ else {
+ /* Delete them nevertheless, with fat warning, user needs to decide whether they want to
+ * save that version of the file (and accept the loss), or not. */
+ id->tag |= LIB_TAG_DOIT;
+ id->tag &= ~LIB_TAG_MISSING;
+ CLOG_WARN(
+ &LOG, "Old override %s is being deleted even though it was user-edited", id->name);
+ }
+#endif
}
}
FOREACH_MAIN_ID_END;