diff options
-rw-r--r-- | source/blender/blenkernel/intern/library_override.c | 4 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 6 |
3 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c index 17cabc247ae..a90a7196aad 100644 --- a/source/blender/blenkernel/intern/library_override.c +++ b/source/blender/blenkernel/intern/library_override.c @@ -557,9 +557,9 @@ void BKE_main_override_static_operations_create(Main *bmain) ID *id; for (id = lb->first; id; id = id->next) { - /* TODO Maybe we could also add an 'override update' tag e.g. when tagging for DEG update? */ - if (id->lib == NULL && id->override_static != NULL && id->override_static->reference != NULL && (id->flag & LIB_OVERRIDE_STATIC_AUTO)) { + if (ID_IS_STATIC_OVERRIDE_AUTO(id) && (id->tag & LIB_TAG_OVERRIDESTATIC_AUTOREFRESH)) { BKE_override_static_operations_create(id); + id->tag &= ~LIB_TAG_OVERRIDESTATIC_AUTOREFRESH; } } } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index f7f55610d22..60fde1e69ee 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -241,6 +241,10 @@ void flush_editors_id_update(Main *bmain, /* Inform editors. */ if (deg_copy_on_write_is_expanded(id_cow)) { deg_editors_id_update(update_ctx, id_cow); + /* ID may need to get its auto-override operations refreshed. */ + if (ID_IS_STATIC_OVERRIDE_AUTO(id_orig)) { + id_orig->tag |= LIB_TAG_OVERRIDESTATIC_AUTOREFRESH; + } /* Inform draw engines that something was changed. */ flush_engine_data_update(id_cow); } diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index d53f290e606..f192c9ea75a 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -387,6 +387,10 @@ typedef enum ID_Type { #define ID_IS_STATIC_OVERRIDE_TEMPLATE(_id) (((ID *)(_id))->override_static != NULL && \ ((ID *)(_id))->override_static->reference == NULL) +#define ID_IS_STATIC_OVERRIDE_AUTO(_id) (!ID_IS_LINKED((_id)) && \ + ID_IS_STATIC_OVERRIDE((_id)) && \ + (((ID *)(_id))->flag & LIB_OVERRIDE_STATIC_AUTO)) + #ifdef GS # undef GS #endif @@ -436,6 +440,8 @@ enum { /* RESET_NEVER tag datablock as being up-to-date regarding its reference. */ LIB_TAG_OVERRIDESTATIC_REFOK = 1 << 9, + /* RESET_NEVER tag datablock as needing an auto-override execution, if enabled. */ + LIB_TAG_OVERRIDESTATIC_AUTOREFRESH = 1 << 17, /* tag datablock has having an extra user. */ LIB_TAG_EXTRAUSER = 1 << 2, |