[Bf-blender-cvs] [3edc8c1f9bc] master: Fix rigid body not resimulating after cache invalidation

Luca Rood noreply at git.blender.org
Tue Jul 4 09:24:06 CEST 2017


Commit: 3edc8c1f9bc625547fc234b8dbe613f3b60c0eb4
Author: Luca Rood
Date:   Tue Jul 4 09:20:02 2017 +0200
Branches: master
https://developer.blender.org/rB3edc8c1f9bc625547fc234b8dbe613f3b60c0eb4

Fix rigid body not resimulating after cache invalidation

Fix 9cd6b03187b91bb2c267a45eac3cee7738e0e220 introduced a bug that
prevented simulation after a cache invalidation (for instance when
changing a setting after simulating). This fixes that.

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index c4fb0aec97b..03977b2c9ae 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1515,8 +1515,10 @@ void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], flo
 
 void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
 {
-	if (rbw)
+	if (rbw) {
 		rbw->pointcache->flag |= PTCACHE_OUTDATED;
+		rbw->ltime = rbw->pointcache->startframe;
+	}
 }
 
 /* ------------------ */




More information about the Bf-blender-cvs mailing list