diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-12 18:28:15 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-12 18:30:07 +0300 |
commit | d70c7c06e76fe4309f3471d44a75e79f729e16b1 (patch) | |
tree | 375d823ea419ce63156673ebe0e878d1addfb8f4 /source/blender/blenkernel/intern/cloth.c | |
parent | 912b4659eca636231d99d7b3611a38791b8270e7 (diff) |
Removed the cloth preroll feature.
This feature has been totally broken for a long time. It was added
originally because negative frames were not supported.
Giving simulations (cloth and others) time to settle before animation
starts needs to be solved in a much better and more generic way.
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 14f94735957..317348903ff 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -88,7 +88,6 @@ void cloth_init(ClothModifierData *clmd ) clmd->sim_parms->stepsPerFrame = 5; clmd->sim_parms->flags = 0; clmd->sim_parms->solver_type = 0; - clmd->sim_parms->preroll = 0; clmd->sim_parms->maxspringlen = 10; clmd->sim_parms->vgroup_mass = 0; clmd->sim_parms->vgroup_shrink = 0; @@ -463,10 +462,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); clmd->sim_parms->timescale= timescale; - if (clmd->sim_parms->reset || - (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0) || - (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts)) - { + if (clmd->sim_parms->reset || (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->numverts)) { clmd->sim_parms->reset = 0; cache->flag |= PTCACHE_OUTDATED; BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); @@ -478,22 +474,6 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived // unused in the moment, calculated separately in implicit.c clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; - /* handle continuous simulation with the play button */ - if ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe)) { - BKE_ptcache_invalidate(cache); - - /* do simulation */ - if (!do_init_cloth(ob, clmd, dm, framenr)) - return; - - do_step_cloth(ob, clmd, dm, framenr); - cloth_to_object(ob, clmd, vertexCos); - - clmd->clothObject->last_frame= framenr; - - return; - } - /* simulation is only active during a specific period */ if (framenr < startframe) { BKE_ptcache_invalidate(cache); @@ -507,7 +487,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived if (!do_init_cloth(ob, clmd, dm, framenr)) return; - if ((framenr == startframe) && (clmd->sim_parms->preroll == 0)) { + if (framenr == startframe) { BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); do_init_cloth(ob, clmd, dm, framenr); BKE_ptcache_validate(cache, framenr); |