diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/blenkernel/intern/object.c | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index ac679adb9c1..6939ff02a47 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -679,7 +679,6 @@ void *add_camera(char *name) cam= alloc_libblock(&G.main->camera, ID_CA, name); cam->lens= 35.0f; - cam->angle= 49.14f; cam->clipsta= 0.1f; cam->clipend= 100.0f; cam->drawsize= 0.5f; @@ -2489,6 +2488,8 @@ void object_handle_update(Scene *scene, Object *ob) ID *data_id= (ID *)ob->data; AnimData *adt= BKE_animdata_from_id(data_id); float ctime= (float)scene->r.cfra; // XXX this is bad... + ListBase pidlist; + PTCacheID *pid; if (G.f & G_DEBUG) printf("recalcdata %s\n", ob->id.name+2); @@ -2577,6 +2578,24 @@ void object_handle_update(Scene *scene, Object *ob) psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated; } } + + /* check if quick cache is needed */ + BKE_ptcache_ids_from_object(&pidlist, ob, scene, MAX_DUPLI_RECUR); + + for(pid=pidlist.first; pid; pid=pid->next) { + if((pid->cache->flag & PTCACHE_BAKED) + || (pid->cache->flag & PTCACHE_QUICK_CACHE)==0) + continue; + + if(pid->cache->flag & PTCACHE_OUTDATED || (pid->cache->flag & PTCACHE_SIMULATION_VALID)==0) { + scene->physics_settings.quick_cache_step = + scene->physics_settings.quick_cache_step ? + MIN2(scene->physics_settings.quick_cache_step, pid->cache->step) : + pid->cache->step; + } + } + + BLI_freelistN(&pidlist); } /* the no-group proxy case, we call update */ |