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:
authorJoshua Leung <aligorith@gmail.com>2013-01-26 09:28:58 +0400
committerJoshua Leung <aligorith@gmail.com>2013-01-26 09:28:58 +0400
commit4f565d48fb9fc280f4794a536dae30dab0e6d65e (patch)
tree54afb9c7683f15eeef424db60ab3d99067b223e9 /source/blender/blenkernel/intern/anim.c
parent27eeb89bd994553c953a0bcb5b64d28f420c5926 (diff)
Motion Path calculations for objects now takes rigidbodies sim effects into
account
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c10
1 files changed, 10 insertions, 0 deletions
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 */