[Bf-blender-cvs] [de7635f607e] blender2.8: Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get()

Joshua Leung noreply at git.blender.org
Fri May 18 18:04:41 CEST 2018


Commit: de7635f607e7b53d69f7befe2d07979f9150314e
Author: Joshua Leung
Date:   Fri May 18 18:04:27 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBde7635f607e7b53d69f7befe2d07979f9150314e

Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get()

There are still probably other massive problems to solve (i.e. which copies
of data cache/sim gets written/read from for COW eval) that need to be solved
before we can get the sims actually running though.

===================================================================

M	source/blender/blenkernel/intern/rigidbody.c

===================================================================

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 5a9b5585efd..28d5cad3da8 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -67,6 +67,7 @@
 #include "BKE_scene.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 /* ************************************** */
 /* Memory Management */
@@ -1697,7 +1698,7 @@ void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, Scene *scene, floa
 void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph,
                                Scene *scene)
 {
-	float ctime = BKE_scene_frame_get(scene);
+	float ctime = DEG_get_ctime(depsgraph);
 	DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime);
 	/* rebuild sim data (i.e. after resetting to start of timeline) */
 	if (BKE_scene_check_rigidbody_active(scene)) {
@@ -1708,7 +1709,7 @@ void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph,
 void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph,
                                    Scene *scene)
 {
-	float ctime = BKE_scene_frame_get(scene);
+	float ctime = DEG_get_ctime(depsgraph);
 	DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime);
 	/* evaluate rigidbody sim */
 	if (BKE_scene_check_rigidbody_active(scene)) {
@@ -1721,7 +1722,7 @@ void BKE_rigidbody_object_sync_transforms(struct Depsgraph *depsgraph,
                                           Object *ob)
 {
 	RigidBodyWorld *rbw = scene->rigidbody_world;
-	float ctime = BKE_scene_frame_get(scene);
+	float ctime = DEG_get_ctime(depsgraph);
 	DEG_debug_print_eval_time(depsgraph, __func__, ob->id.name, ob, ctime);
 	/* read values pushed into RBO from sim/cache... */
 	BKE_rigidbody_sync_transforms(rbw, ob, ctime);



More information about the Bf-blender-cvs mailing list