[Bf-blender-cvs] [96064c3bb7d] master: LibOverride: Do not delete no-more-used overrides during resync if they are user-edited.
Bastien Montagne
noreply at git.blender.org
Thu Mar 11 14:33:45 CET 2021
Commit: 96064c3bb7d135ab69eb4a146c173dc4a36db1cc
Author: Bastien Montagne
Date: Fri Mar 5 09:12:40 2021 +0100
Branches: master
https://developer.blender.org/rB96064c3bb7d135ab69eb4a146c173dc4a36db1cc
LibOverride: Do not delete no-more-used overrides during resync if they are user-edited.
Ultimately those will be listed with a special icon in the upcomming
Outliner overrides view.
Part of T83811 & D10649.
===================================================================
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 40699f41275..95643773088 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -1001,11 +1001,23 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_
}
id->tag &= ~LIB_TAG_DOIT;
}
- /* Also cleanup old overrides that went missing in new linked data. */
+ /* Also deal with old overrides that went missing in new linked data. */
else if (id->tag & LIB_TAG_MISSING && !ID_IS_LINKED(id)) {
BLI_assert(ID_IS_OVERRIDE_LIBRARY(id));
- id->tag |= LIB_TAG_DOIT;
- id->tag &= ~LIB_TAG_MISSING;
+ if (!BKE_lib_override_library_is_user_edited(id)) {
+ /* If user never edited them, we can delete them. */
+ id->tag |= LIB_TAG_DOIT;
+ id->tag &= ~LIB_TAG_MISSING;
+ printf("%s: Old override %s is being deleted.\n", __func__, id->name);
+ }
+ else {
+ /* Otherwise, keep them, user needs to decide whether what to do with them. */
+ BLI_assert((id->tag & LIB_TAG_DOIT) == 0);
+ id_fake_user_set(id);
+ printf("%s: Old override %s is being kept around as it was user-edited.\n",
+ __func__,
+ id->name);
+ }
}
}
FOREACH_MAIN_ID_END;
More information about the Bf-blender-cvs
mailing list