diff options
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index b19b0e684b2..25951fa3e6f 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -475,7 +475,7 @@ static void scene_foreach_rigidbodyworldSceneLooper(struct RigidBodyWorld *UNUSE /** * This code is shared by both the regular `foreach_id` looper, and the code trying to restore or - * preserve ID pointers like brushes across undoes. + * preserve ID pointers like brushes across undo-steps. */ typedef enum eSceneForeachUndoPreserveProcess { /* Undo when preserving tool-settings from old scene, we also want to try to preserve that ID @@ -1689,6 +1689,19 @@ static void scene_undo_preserve(BlendLibReader *reader, ID *id_new, ID *id_old) } } +static void scene_lib_override_apply_post(ID *id_dst, ID *UNUSED(id_src)) +{ + Scene *scene = (Scene *)id_dst; + + if (scene->rigidbody_world != NULL) { + PTCacheID pid; + BKE_ptcache_id_from_rigidbody(&pid, NULL, scene->rigidbody_world); + LISTBASE_FOREACH (PointCache *, point_cache, pid.ptcaches) { + point_cache->flag |= PTCACHE_FLAG_INFO_DIRTY; + } + } +} + IDTypeInfo IDType_ID_SCE = { .id_code = ID_SCE, .id_filter = FILTER_ID_SCE, @@ -1714,6 +1727,8 @@ IDTypeInfo IDType_ID_SCE = { .blend_read_expand = scene_blend_read_expand, .blend_read_undo_preserve = scene_undo_preserve, + + .lib_override_apply_post = scene_lib_override_apply_post, }; const char *RE_engine_id_BLENDER_EEVEE = "BLENDER_EEVEE"; |