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:
authorJanne Karhu <jhkarh@gmail.com>2010-12-01 00:31:18 +0300
committerJanne Karhu <jhkarh@gmail.com>2010-12-01 00:31:18 +0300
commit17cd5811e767df5bc7247648e3cbe52e39575f56 (patch)
tree71353d23d7bc5868620f1a344c2976e7d5eae316 /source/blender/makesrna/intern/rna_object_force.c
parent005feca62d0fafb665c348f0dc75d804cc15bf2d (diff)
Smoke now uses only one point cache where both normal and high resolution smoke are stored together:
* Separate caches were causing quite a lot of problems both in principle and practice. * For example it doesn't really make sense to have different frame ranges for normal and high resolution smoke, but this was fully possible before. * Also to fully bake the smoke you had to do a "Bake All Dynamics", which completely defeats the whole point of the feature! * As a result of this change the smoke cache usage is much much simpler and less error prone. * This is quite a big change, but hopefully there should be less rather than more problems as a result :) Some other related changes: * Changing the cache name now works for disk caches properly too, it now just renames the cache files so should be faster too! * Smoke is now always forced to disk cache with step 1 on file load as there were some strange cases where smoke was trying to use memory cache. * Disabled smoke debug prints from console. * Disabled changing smoke parameters when smoke is baked. Note to users: The unfortunate side effect of this is that old high resolution simulations have to be baked again, but in return you get much better and more logical functionality. Sorry none the less!
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index a28e0b32eae..cdcc57bde12 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -117,8 +117,12 @@ static void rna_Cache_change(Main *bmain, Scene *scene, PointerRNA *ptr)
break;
}
- if(pid)
+ if(pid) {
+ /* Just make sure this wasn't changed. */
+ if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
+ cache->step = 1;
BKE_ptcache_update_info(pid);
+ }
BLI_freelistN(&pidlist);
}
@@ -140,8 +144,11 @@ static void rna_Cache_toggle_disk_cache(Main *bmain, Scene *scene, PointerRNA *p
break;
}
- if(pid)
+ /* smoke can only use disk cache */
+ if(pid && pid->type != PTCACHE_TYPE_SMOKE_DOMAIN)
BKE_ptcache_toggle_disk_cache(pid);
+ else
+ cache->flag ^= PTCACHE_DISK_CACHE;
BLI_freelistN(&pidlist);
}
@@ -153,7 +160,6 @@ static void rna_Cache_idname_change(Main *bmain, Scene *scene, PointerRNA *ptr)
PTCacheID *pid = NULL, *pid2= NULL;
ListBase pidlist;
int new_name = 1;
- char name[80];
if(!ob)
return;
@@ -188,19 +194,13 @@ static void rna_Cache_idname_change(Main *bmain, Scene *scene, PointerRNA *ptr)
if(new_name) {
if(pid2 && cache->flag & PTCACHE_DISK_CACHE) {
- /* TODO: change to simple file rename */
- strcpy(name, cache->name);
- strcpy(cache->name, cache->prev_name);
-
- cache->flag &= ~PTCACHE_DISK_CACHE;
-
- BKE_ptcache_toggle_disk_cache(pid2);
-
- strcpy(cache->name, name);
+ char old_name[80];
+ char new_name[80];
- cache->flag |= PTCACHE_DISK_CACHE;
+ strcpy(old_name, cache->prev_name);
+ strcpy(new_name, cache->name);
- BKE_ptcache_toggle_disk_cache(pid2);
+ BKE_ptcache_disk_cache_rename(pid2, old_name, new_name);
}
strcpy(cache->prev_name, cache->name);