diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-19 16:13:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-19 16:13:21 +0300 |
commit | 4755ab9f80df7ed52366b7928658e89c54fa15ac (patch) | |
tree | 5e4e18a28198e1def2263c4142dd0b48aa5df83a /source | |
parent | f09dc08523e5f5f995e8bb163ddd7e6b86f9cd60 (diff) |
scene_update_for_newframe was calling DAG_scene_update_flags() and BKE_animsys_evaluate_all_animation() for each set.
gain some speedup by only calling once.
minor printf changes to readfile.c, no functional change.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 45 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 |
2 files changed, 33 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index a08c83eaefe..975c6de7025 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -862,20 +862,6 @@ static void scene_update_newframe(Scene *sce, unsigned int lay) { Base *base; Object *ob; - float ctime = frame_to_float(sce, sce->r.cfra); - - if(sce->theDag==NULL) - DAG_scene_sort(sce); - - DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still - - /* All 'standard' (i.e. without any dependencies) animation is handled here, - * with an 'local' to 'macro' order of evaluation. This should ensure that - * settings stored nestled within a hierarchy (i.e. settings in a Texture block - * can be overridden by settings from Scene, which owns the Texture through a hierarchy - * such as Scene->World->MTex/Texture) can still get correctly overridden. - */ - BKE_animsys_evaluate_all_animation(G.main, ctime); for(base= sce->base.first; base; base= base->next) { ob= base->object; @@ -928,16 +914,37 @@ void scene_update_tagged(Scene *scene) /* applies changes right away, does all sets too */ void scene_update_for_newframe(Scene *sce, unsigned int lay) { - Scene *scene= sce; + float ctime = frame_to_float(sce, sce->r.cfra); + Scene *sce_iter; /* clear animation overrides */ // XXX TODO... - + + for(sce_iter= sce; sce_iter; sce_iter= sce_iter->set) { + if(sce_iter->theDag==NULL) + DAG_scene_sort(sce_iter); + } + + + /* Following 2 functions are recursive + * so dont call within 'scene_update_newframe' */ + DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still + + /* All 'standard' (i.e. without any dependencies) animation is handled here, + * with an 'local' to 'macro' order of evaluation. This should ensure that + * settings stored nestled within a hierarchy (i.e. settings in a Texture block + * can be overridden by settings from Scene, which owns the Texture through a hierarchy + * such as Scene->World->MTex/Texture) can still get correctly overridden. + */ + BKE_animsys_evaluate_all_animation(G.main, ctime); + /*...done with recusrive funcs */ + + /* sets first, we allow per definition current scene to have dependencies on sets */ - for(sce= sce->set; sce; sce= sce->set) - scene_update_newframe(sce, lay); + for(sce_iter= sce->set; sce_iter; sce_iter= sce_iter->set) + scene_update_newframe(sce_iter, lay); - scene_update_newframe(scene, lay); + scene_update_newframe(sce, lay); } /* return default layer, also used to patch old files */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f4112bde8da..61f101dee8c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3436,6 +3436,7 @@ static void lib_link_object(FileData *fd, Main *main) if(ob->proxy->id.lib==NULL) { ob->proxy->proxy_from= NULL; ob->proxy= NULL; + printf("Proxy lost from object %s lib %s\n", ob->id.name+2, ob->id.lib->name); } else { /* this triggers object_update to always use a copy */ @@ -3450,11 +3451,14 @@ static void lib_link_object(FileData *fd, Main *main) ob->data= newlibadr_us(fd, ob->id.lib, ob->data); if(ob->data==NULL && poin!=NULL) { + if(ob->id.lib) + printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name); + else + printf("Object %s lost data.\n", ob->id.name+2); + ob->type= OB_EMPTY; warn= 1; - if(ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name); - else printf("Object %s lost data.\n", ob->id.name+2); - + if(ob->pose) { free_pose(ob->pose); ob->pose= NULL; |