From be7106a974646483f4b087539c62603fe53560cf Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 22 Jan 2021 14:52:50 +0100 Subject: LibOverride: Add an 'post apply' callback to IDTypeInfo. Currently this is needed to properly tag PointCache's for info update (fixes an issue reported in T82503). Suspect we may need this in more cases in the future though, RNA assign/update processes are not always 100% enough to deal with complicated corner cases. --- source/blender/blenkernel/intern/object.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenkernel/intern/object.c') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 750a4cbd358..381823754e9 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1118,6 +1118,20 @@ static void object_blend_read_expand(BlendExpander *expander, ID *id) } } +static void object_lib_override_apply_post(ID *id_dst, ID *UNUSED(id_src)) +{ + Object *object = (Object *)id_dst; + + ListBase pidlist; + BKE_ptcache_ids_from_object(&pidlist, object, NULL, 0); + LISTBASE_FOREACH (PTCacheID *, pid, &pidlist) { + LISTBASE_FOREACH (PointCache *, point_cache, pid->ptcaches) { + point_cache->flag |= PTCACHE_FLAG_INFO_DIRTY; + } + } + BLI_freelistN(&pidlist); +} + IDTypeInfo IDType_ID_OB = { .id_code = ID_OB, .id_filter = FILTER_ID_OB, @@ -1141,6 +1155,8 @@ IDTypeInfo IDType_ID_OB = { .blend_read_expand = object_blend_read_expand, .blend_read_undo_preserve = NULL, + + .lib_override_apply_post = object_lib_override_apply_post, }; void BKE_object_workob_clear(Object *workob) -- cgit v1.2.3