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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user