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:
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 03977b2c9ae..c18366d1b8a 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1517,7 +1517,6 @@ void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw)
{
if (rbw) {
rbw->pointcache->flag |= PTCACHE_OUTDATED;
- rbw->ltime = rbw->pointcache->startframe;
}
}
@@ -1580,6 +1579,10 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
// RB_TODO deal with interpolated, old and baked results
bool can_simulate = (ctime == rbw->ltime + 1) && !(cache->flag & PTCACHE_BAKED);
+ if (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0) {
+ rbw->ltime = cache->startframe;
+ }
+
if (BKE_ptcache_read(&pid, ctime, can_simulate)) {
BKE_ptcache_validate(cache, (int)ctime);
return;