diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-02-24 16:37:53 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-02-24 16:37:53 +0300 |
commit | acf8a9c6ec58eb5937b78b371396f0acb3a4d639 (patch) | |
tree | a656202a234697e18ef97cdf1864d27f381bb6a5 /source/blender/blenloader/intern | |
parent | cd615f6fcc143cfd630a8d784ea8d59256cfe84e (diff) |
Fix for [#26197] High resolution smoke cache not available due to pointcache update. Please reset the simulation.
* Backwards compatibility code wasn't forwards compatible :)
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5737dfd51da..4c5a281e966 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3963,7 +3963,14 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) /* Smoke uses only one cache from now on, so store pointer convert */ if(smd->domain->ptcaches[1].first || smd->domain->point_cache[1]) { - printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n"); + if(smd->domain->point_cache[1]) { + PointCache *cache = newdataadr(fd, smd->domain->point_cache[1]); + if(cache->flag & PTCACHE_FAKE_SMOKE) + ; /* Smoke was already saved in "new format" and this cache is a fake one. */ + else + printf("High resolution smoke cache not available due to pointcache update. Please reset the simulation.\n"); + BKE_ptcache_free(cache); + } smd->domain->ptcaches[1].first = NULL; smd->domain->ptcaches[1].last = NULL; smd->domain->point_cache[1] = NULL; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 8d0656e45e1..d2d6c2412cd 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1220,7 +1220,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) /* create fake pointcache so that old blender versions can read it */ smd->domain->point_cache[1] = BKE_ptcache_add(&smd->domain->ptcaches[1]); - smd->domain->point_cache[1]->flag |= PTCACHE_DISK_CACHE; + smd->domain->point_cache[1]->flag |= PTCACHE_DISK_CACHE|PTCACHE_FAKE_SMOKE; smd->domain->point_cache[1]->step = 1; write_pointcaches(wd, &(smd->domain->ptcaches[1])); |