From d4340289a61821b83e54b007fda3752f8ba82fbc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Apr 2010 14:57:12 +0000 Subject: 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. --- source/blender/blenkernel/intern/scene.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/scene.c') 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 */ -- cgit v1.2.3