rigidbody: Don't run simulation if cache is baked

In rare cases this would allow the simulation to run before being
initialized (if cache is baked and reading cache fails after undo or
loading a file).
This commit is contained in:
Sergej Reich
2013-02-19 20:04:08 +00:00
parent 3d41532554
commit 3e5f6293b6

View File

@@ -1259,7 +1259,7 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
}
/* advance simulation, we can only step one frame forward */
if (ctime == rbw->ltime + 1) {
if (ctime == rbw->ltime + 1 && !(cache->flag & PTCACHE_BAKED)) {
/* write cache for first frame when on second frame */
if (rbw->ltime == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) {
BKE_ptcache_write(&pid, startframe);