From 4f565d48fb9fc280f4794a536dae30dab0e6d65e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 26 Jan 2013 05:28:58 +0000 Subject: Motion Path calculations for objects now takes rigidbodies sim effects into account --- source/blender/blenkernel/intern/anim.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/blenkernel/intern/anim.c') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 4058809c275..dab54756c82 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -69,6 +69,7 @@ #include "BKE_depsgraph.h" #include "BKE_anim.h" #include "BKE_report.h" +#include "BKE_rigidbody.h" // XXX bad level call... @@ -327,6 +328,7 @@ static void motionpaths_calc_update_scene(Scene *scene) { #if 1 // 'production' optimizations always on Base *base, *last = NULL; + float ctime = BKE_scene_frame_get(scene); /* only stuff that moves or needs display still */ DAG_scene_update_flags(G.main, scene, scene->lay, TRUE); @@ -340,6 +342,14 @@ static void motionpaths_calc_update_scene(Scene *scene) last = base; } + /* run rigidbody sim + * NOTE: keep in sync with BKE_scene_update_for_newframe() in scene.c + */ + // XXX: this position may still change, objects not being updated correctly before simulation is run + // NOTE: current position is so that rigidbody sim affects other objects + if (BKE_scene_check_rigidbody_active(scene)) + BKE_rigidbody_do_simulation(scene, ctime); + /* perform updates for tagged objects */ /* XXX: this will break if rigs depend on scene or other data that * is animated but not attached to/updatable from objects */ -- cgit v1.2.3