diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-30 16:23:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-30 16:23:13 +0400 |
commit | 515592438f0f5665cadbd12c7698554bd2b89146 (patch) | |
tree | ab1e07b6093f380661b9fca4ebf3df90e0705055 /source/blender/editors/physics/physics_pointcache.c | |
parent | 71446eea573db3ac6bac5f297c0655acbeada67c (diff) |
Baking for dupligroup & linked library objects
- library data allows pointcache writing (hard to know how this should work long term so ifdef'd for now)
- changing the frame now updates the dupligroup objects
- BKE_ptcache_ids_from_object(), option to get the id's from duplis
note! scene_update_tagged() is called from the main() loop, and runs BKE_ptcache_quick_cache_all(), this could become a performance issue, especially with duplis, should probably not call BKE_ptcache_quick_cache_all() all the time, even when not playing back animation.
(commits 27856 by Campbell from render25 branch)
Diffstat (limited to 'source/blender/editors/physics/physics_pointcache.c')
-rw-r--r-- | source/blender/editors/physics/physics_pointcache.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 19f4d8457c1..57a123d8f17 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -33,6 +33,7 @@ #include "DNA_scene_types.h" +#include "BKE_anim.h" #include "BKE_context.h" #include "BKE_particle.h" #include "BKE_report.h" @@ -125,7 +126,7 @@ static int ptcache_free_bake_all_exec(bContext *C, wmOperator *op) ListBase pidlist; for(base=scene->base.first; base; base= base->next) { - BKE_ptcache_ids_from_object(&pidlist, base->object); + BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR); for(pid=pidlist.first; pid; pid=pid->next) { pid->cache->flag &= ~PTCACHE_BAKED; @@ -178,7 +179,7 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) PTCacheID *pid; ListBase pidlist; - BKE_ptcache_ids_from_object(&pidlist, ob); + BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache == cache) @@ -290,7 +291,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *op) PTCacheID *pid; ListBase pidlist; - BKE_ptcache_ids_from_object(&pidlist, ob); + BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache == cache) { @@ -308,12 +309,13 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *op) static int ptcache_remove_exec(bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); + Scene *scene= CTX_data_scene(C); Object *ob= ptr.id.data; PointCache *cache= ptr.data; PTCacheID *pid; ListBase pidlist; - BKE_ptcache_ids_from_object(&pidlist, ob); + BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache == cache) { |