diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-11-11 20:59:52 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-11-11 20:59:52 +0300 |
commit | c69bc46c98d09f85f6f408b0e3bd5008565d7402 (patch) | |
tree | 80a8c89f3309f0380b465ee15a07f4a5cf9a3755 | |
parent | 1659e3fca76a60da1de2427113633ca06aac33e5 (diff) |
Smoke now uses the start and end of cached data properly when outside the cached frame range.
* Patch by MiikaH.
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index aafa2d9870c..c1090326fd9 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -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); |