[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54104] trunk/blender/source/blender/ blenkernel/intern/anim.c: Motion Path calculations for objects now takes rigidbodies sim effects into

Joshua Leung aligorith at gmail.com
Sat Jan 26 06:29:02 CET 2013


Revision: 54104
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54104
Author:   aligorith
Date:     2013-01-26 05:28:58 +0000 (Sat, 26 Jan 2013)
Log Message:
-----------
Motion Path calculations for objects now takes rigidbodies sim effects into
account

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/anim.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c	2013-01-26 03:30:21 UTC (rev 54103)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c	2013-01-26 05:28:58 UTC (rev 54104)
@@ -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 @@
 {
 #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 @@
 			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 */




More information about the Bf-blender-cvs mailing list