From d70c7c06e76fe4309f3471d44a75e79f729e16b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Thu, 12 Feb 2015 16:28:15 +0100 Subject: 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. --- source/blender/blenkernel/intern/cloth.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'source/blender/blenkernel/intern/cloth.c') 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); -- cgit v1.2.3