sim: Remove "continue physics" code

This was left over from 2.4x days and is not used anymore.
Now simulations are always interactive.
This commit is contained in:
Sergej Reich 2013-01-22 20:47:03 +00:00
parent 8733150ac1
commit 8b8d4ba7ef
8 changed files with 6 additions and 57 deletions

@ -294,10 +294,6 @@ int BKE_ptcache_read(PTCacheID *pid, float cfra);
/* Main cache writing call. */ /* Main cache writing call. */
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra); int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra);
/****************** Continue physics ***************/
void BKE_ptcache_set_continue_physics(struct Main *bmain, struct Scene *scene, int enable);
int BKE_ptcache_get_continue_physics(void);
/******************* Allocate & free ***************/ /******************* Allocate & free ***************/
struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches); struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
void BKE_ptcache_free_mem(struct ListBase *mem_cache); void BKE_ptcache_free_mem(struct ListBase *mem_cache);

@ -483,7 +483,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived
clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame;
/* handle continuous simulation with the play button */ /* handle continuous simulation with the play button */
if (BKE_ptcache_get_continue_physics() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) { if ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe)) {
BKE_ptcache_invalidate(cache); BKE_ptcache_invalidate(cache);
/* do simulation */ /* do simulation */

@ -4500,7 +4500,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
int startframe = 0, endframe = 100, oldtotpart = 0; int startframe = 0, endframe = 100, oldtotpart = 0;
/* cache shouldn't be used for hair or "continue physics" */ /* cache shouldn't be used for hair or "continue physics" */
if (part->type != PART_HAIR && BKE_ptcache_get_continue_physics() == 0) { if (part->type != PART_HAIR) {
psys_clear_temp_pointcache(psys); psys_clear_temp_pointcache(psys);
/* set suitable cache range automatically */ /* set suitable cache range automatically */

@ -2536,7 +2536,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
after= 0; after= 0;
if (mode == PTCACHE_RESET_DEPSGRAPH) { if (mode == PTCACHE_RESET_DEPSGRAPH) {
if (!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) { if (!(cache->flag & PTCACHE_BAKED)) {
after= 1; after= 1;
} }
@ -2544,12 +2544,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
cache->flag |= PTCACHE_OUTDATED; cache->flag |= PTCACHE_OUTDATED;
} }
else if (mode == PTCACHE_RESET_BAKED) { else if (mode == PTCACHE_RESET_BAKED) {
if (!BKE_ptcache_get_continue_physics()) { cache->flag |= PTCACHE_OUTDATED;
reset= 1;
clear= 1;
}
else
cache->flag |= PTCACHE_OUTDATED;
} }
else if (mode == PTCACHE_RESET_OUTDATED) { else if (mode == PTCACHE_RESET_OUTDATED) {
reset = 1; reset = 1;
@ -2695,30 +2690,6 @@ void BKE_ptcache_remove(void)
} }
} }
/* Continuous Interaction */
static int CONTINUE_PHYSICS = 0;
void BKE_ptcache_set_continue_physics(Main *bmain, Scene *scene, int enable)
{
Object *ob;
if (CONTINUE_PHYSICS != enable) {
CONTINUE_PHYSICS = enable;
if (CONTINUE_PHYSICS == 0) {
for (ob=bmain->object.first; ob; ob=ob->id.next)
if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
}
int BKE_ptcache_get_continue_physics(void)
{
return CONTINUE_PHYSICS;
}
/* Point Cache handling */ /* Point Cache handling */
PointCache *BKE_ptcache_add(ListBase *ptcaches) PointCache *BKE_ptcache_add(ListBase *ptcaches)

@ -4108,18 +4108,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
softbody_reset(ob, sb, vertexCos, numVerts); softbody_reset(ob, sb, vertexCos, numVerts);
} }
/* continue physics special case */
if (BKE_ptcache_get_continue_physics()) {
BKE_ptcache_invalidate(cache);
/* do simulation */
dtime = timescale;
softbody_update_positions(ob, sb, vertexCos, numVerts);
softbody_step(scene, ob, sb, dtime);
softbody_to_object(ob, vertexCos, numVerts, 0);
sb->last_frame = framenr;
return;
}
/* still no points? go away */ /* still no points? go away */
if (sb->totpoint==0) { if (sb->totpoint==0) {
return; return;

@ -2124,12 +2124,6 @@ void transformApply(bContext *C, TransInfo *t)
t->state = TRANS_CONFIRM; t->state = TRANS_CONFIRM;
} }
if (BKE_ptcache_get_continue_physics()) {
// TRANSFORM_FIX_ME
//do_screenhandlers(G.curscreen);
t->redraw |= TREDRAW_HARD;
}
t->context = NULL; t->context = NULL;
} }

@ -434,7 +434,7 @@ typedef enum eScreen_Redraws_Flag {
TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */ TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
TIME_SEQ = (1 << 5), TIME_SEQ = (1 << 5),
TIME_ALL_IMAGE_WIN = (1 << 6), TIME_ALL_IMAGE_WIN = (1 << 6),
TIME_CONTINUE_PHYSICS = (1 << 7), TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
TIME_NODES = (1 << 8), TIME_NODES = (1 << 8),
TIME_CLIPS = (1 << 9), TIME_CLIPS = (1 << 9),
} eScreen_Redraws_Flag; } eScreen_Redraws_Flag;

@ -137,7 +137,7 @@ static void deformVerts(ModifierData *md, Object *ob,
numverts = dm->getNumVerts(dm); numverts = dm->getNumVerts(dm);
if ((current_time > collmd->time_xnew) || (BKE_ptcache_get_continue_physics())) { if (current_time > collmd->time_xnew) {
unsigned int i; unsigned int i;
/* check if mesh has changed */ /* check if mesh has changed */