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.
This commit is contained in:
Bastien Montagne 2021-05-06 18:33:42 +02:00
parent 23acca0c32
commit aa8e058a59
1 changed files with 11 additions and 0 deletions

View File

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