diff options
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index de9c063f069..bbdd6891199 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -181,6 +181,7 @@ static void time_cache_refresh(const bContext *C, SpaceTime *stime, ARegion *ar) SpaceTimeCache *stc; float *fp, *array; int i, len; + int sta, end; switch(pid->type) { case PTCACHE_TYPE_SOFTBODY: @@ -197,6 +198,11 @@ static void time_cache_refresh(const bContext *C, SpaceTime *stime, ARegion *ar) if (!(stime->cache_display & TIME_CACHE_SMOKE)) continue; break; } + + BKE_ptcache_id_time(pid, CTX_data_scene(C), 0, &sta, &end, NULL); + + if(pid->cache->cached_frames==NULL) + continue; stc= MEM_callocN(sizeof(SpaceTimeCache), "spacetimecache"); @@ -208,14 +214,15 @@ static void time_cache_refresh(const bContext *C, SpaceTime *stime, ARegion *ar) stc->flag |= PTCACHE_DISK_CACHE; /* first allocate with maximum number of frames needed */ - BKE_ptcache_id_time(pid, CTX_data_scene(C), 0, &stc->startframe, &stc->endframe, NULL); - len = (stc->endframe - stc->startframe + 1)*4; + stc->startframe = sta; + stc->endframe = end; + len = (end - sta + 1)*4; fp = array = MEM_callocN(len*2*sizeof(float), "temporary timeline cache array"); /* fill the vertex array with a quad for each cached frame */ - for (i=stc->startframe; i<=stc->endframe; i++) { + for (i=sta; i<=end; i++) { - if (BKE_ptcache_id_exist(pid, i)) { + if (pid->cache->cached_frames[i-sta]) { fp[0] = (float)i; fp[1] = 0.0; fp+=2; |