Smoke now uses the start and end of cached data properly when outside the cached frame range.

* Patch by MiikaH.
This commit is contained in:
Janne Karhu
2010-11-11 17:59:52 +00:00
parent 1659e3fca7
commit c69bc46c98

View File

@@ -1353,13 +1353,17 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
}
}
if(framenr < startframe)
if(!smd->domain->fluid && (framenr != startframe) && (cache->flag & PTCACHE_BAKED)==0)
return;
if(framenr < startframe)
framenr = startframe;
if(framenr > endframe)
return;
framenr = endframe;
if(!smd->domain->fluid && (framenr != startframe) && (cache->flag & PTCACHE_BAKED)==0)
/* If already viewing a pre/after frame, no need to reload */
if ((smd->time == framenr) && (framenr != scene->r.cfra))
return;
// printf("startframe: %d, framenr: %d\n", startframe, framenr);
@@ -1402,6 +1406,10 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
else if(framenr != (int)smd->time+1)
return;
/* don't simulate if viewing start frame, but scene frame is not real start frame */
if (framenr != scene->r.cfra)
return;
tstart();
smoke_calc_domain(scene, ob, smd);