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-01-22 16:52:50 +0300
committerBastien Montagne <bastien@blender.org>2021-01-22 17:31:15 +0300
commitbe7106a974646483f4b087539c62603fe53560cf (patch)
treee980cf77d9698b934111ccd52d27571c043d8214 /source/blender/blenkernel/intern/object.c
parent7e32bb849265bde7dc58fdf698fd876af6b1dfd6 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c16
1 files changed, 16 insertions, 0 deletions
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)