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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-02 18:57:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-02 18:57:12 +0400
commitd4340289a61821b83e54b007fda3752f8ba82fbc (patch)
tree40d0ab5160a507ff53e2cf532c87307f093e63a4 /source
parent70540fca3bfa90d21531c84e42aa7a4f74b52826 (diff)
Set Scenes and Physics
- objects in a set scene now are evaluated with the frame from the current scene. - pointcache now loops over all set scene objects.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/pointcache.c12
-rw-r--r--source/blender/blenkernel/intern/scene.c17
2 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 8efa9e29698..807e25955a7 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -560,7 +560,7 @@ static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, flo
static int ptcache_totpoint_cloth(void *cloth_v, int cfra)
{
ClothModifierData *clmd= cloth_v;
- return clmd->clothObject->numverts;
+ return clmd->clothObject ? clmd->clothObject->numverts : 0;
}
/* Creating ID's */
@@ -2327,12 +2327,13 @@ PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old
/* Baking */
static int count_quick_cache(Scene *scene, int *quick_step)
{
- Base *base = scene->base.first;
+ Base *base;
PTCacheID *pid;
ListBase pidlist;
int autocache_count= 0;
+ Scene *sce; /* for macro only */
- for(base = scene->base.first; base; base = base->next) {
+ for(SETLOOPER(scene, base)) {
if(base->object) {
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
@@ -2401,6 +2402,7 @@ static void *ptcache_make_cache_thread(void *ptr) {
void BKE_ptcache_make_cache(PTCacheBaker* baker)
{
Scene *scene = baker->scene;
+ Scene *sce; /* SETLOOPER macro only */
Base *base;
ListBase pidlist;
PTCacheID *pid = baker->pid;
@@ -2465,7 +2467,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
cache->flag &= ~PTCACHE_BAKED;
}
}
- else for(base=scene->base.first; base; base= base->next) {
+ for(SETLOOPER(scene, base)) {
/* cache/bake everything in the scene */
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
@@ -2548,7 +2550,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
BKE_ptcache_write_cache(pid, 0);
}
}
- else for(base=scene->base.first; base; base= base->next) {
+ else for(SETLOOPER(scene, base)) {
BKE_ptcache_ids_from_object(&pidlist, base->object, scene, MAX_DUPLI_RECUR);
for(pid=pidlist.first; pid; pid=pid->next) {
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index c258f2d47b7..fc6b7e7d789 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -891,10 +891,12 @@ float frame_to_float (Scene *scene, int cfra) /* see also bsystem_time in objec
return ctime;
}
-static void scene_update_newframe(Scene *scene, unsigned int lay)
+static void scene_update_newframe(Scene *scene, int cfra, unsigned int lay)
{
Base *base;
Object *ob;
+ int cfra_back= scene->r.cfra;
+ scene->r.cfra= cfra;
for(base= scene->base.first; base; base= base->next) {
ob= base->object;
@@ -910,6 +912,8 @@ static void scene_update_newframe(Scene *scene, unsigned int lay)
// base->lay= ob->lay;
//}
}
+
+ scene->r.cfra= cfra_back;
}
/* this is called in main loop, doing tagged updates before redraw */
@@ -956,10 +960,6 @@ void scene_update_tagged(Scene *scene)
/* XXX - this is called far to often, should be made apart of the depgraph */
BKE_ptcache_quick_cache_all(scene);
- sce= scene;
- while((sce= sce->set))
- BKE_ptcache_quick_cache_all(sce);
-
/* in the future this should handle updates for all datablocks, not
only objects and scenes. - brecht */
}
@@ -994,10 +994,11 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
/* sets first, we allow per definition current scene to have dependencies on sets */
- for(sce_iter= sce->set; sce_iter; sce_iter= sce_iter->set)
- scene_update_newframe(sce_iter, lay);
+ for(sce_iter= sce->set; sce_iter; sce_iter= sce_iter->set) {
+ scene_update_newframe(sce_iter, sce->r.cfra, lay);
+ }
- scene_update_newframe(sce, lay);
+ scene_update_newframe(sce, sce->r.cfra, lay);
}
/* return default layer, also used to patch old files */