Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 419ef90ab3a..fcff021092d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2947,14 +2947,19 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache)
cache->cached_frames= NULL;
}
-static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache)
+static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache, int force_disk)
{
PointCache *cache;
if(ptcaches->first) {
link_list(fd, ptcaches);
- for(cache=ptcaches->first; cache; cache=cache->next)
+ for(cache=ptcaches->first; cache; cache=cache->next) {
direct_link_pointcache(fd, cache);
+ if(force_disk) {
+ cache->flag |= PTCACHE_DISK_CACHE;
+ cache->step = 1;
+ }
+ }
*ocache = newdataadr(fd, *ocache);
}
@@ -2962,6 +2967,10 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC
/* old "single" caches need to be linked too */
*ocache = newdataadr(fd, *ocache);
direct_link_pointcache(fd, *ocache);
+ if(force_disk) {
+ (*ocache)->flag |= PTCACHE_DISK_CACHE;
+ cache->step = 1;
+ }
ptcaches->first = ptcaches->last = *ocache;
}
@@ -3150,7 +3159,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->pdd = NULL;
psys->renderdata = NULL;
- direct_link_pointcache_list(fd, &psys->ptcaches, &psys->pointcache);
+ direct_link_pointcache_list(fd, &psys->ptcaches, &psys->pointcache, 0);
if(psys->clmd) {
psys->clmd = newdataadr(fd, psys->clmd);
@@ -3757,7 +3766,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
clmd->sim_parms= newdataadr(fd, clmd->sim_parms);
clmd->coll_parms= newdataadr(fd, clmd->coll_parms);
- direct_link_pointcache_list(fd, &clmd->ptcaches, &clmd->point_cache);
+ direct_link_pointcache_list(fd, &clmd->ptcaches, &clmd->point_cache, 0);
if(clmd->sim_parms) {
if(clmd->sim_parms->presets > 10)
@@ -3799,8 +3808,14 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
if(!smd->domain->effector_weights)
smd->domain->effector_weights = BKE_add_effector_weights(NULL);
- direct_link_pointcache_list(fd, &(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0]));
- direct_link_pointcache_list(fd, &(smd->domain->ptcaches[1]), &(smd->domain->point_cache[1]));
+ direct_link_pointcache_list(fd, &(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0]), 1);
+
+ /* 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");
+ smd->domain->ptcaches[1].first = smd->domain->ptcaches[1].first = NULL;
+ smd->domain->point_cache[1] = NULL;
+ }
}
else if(smd->type==MOD_SMOKE_TYPE_FLOW)
{
@@ -4034,7 +4049,7 @@ static void direct_link_object(FileData *fd, Object *ob)
if(!sb->effector_weights)
sb->effector_weights = BKE_add_effector_weights(NULL);
- direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache);
+ direct_link_pointcache_list(fd, &sb->ptcaches, &sb->pointcache, 0);
}
ob->bsoft= newdataadr(fd, ob->bsoft);
ob->fluidsimSettings= newdataadr(fd, ob->fluidsimSettings); /* NT */