From 20220d47e38c4ad22ad89481fd40b804cc2fd1ef Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 21 Feb 2013 19:33:04 +0000 Subject: Dependency Graph: some refactoring which should have no user visible impact besides performance in some cases. * DAG_scene_sort is now removed and replaced by DAG_relations_tag_update in most cases. This will clear the dependency graph, and only rebuild it right before it's needed again when the scene is re-evaluated. This is done because DAG_scene_sort is slow when called many times from python operators. Further the scene argument is not needed because most operations can potentially affect more than the current scene. * DAG_scene_relations_update will now rebuild the dependency graph if it's not there yet, and DAG_scene_relations_rebuild will force a rebuild for the rare cases that need it. * Remove various places where ob->recalc was set manually. This should go through DAG_id_tag_update() in nearly all cases instead since this is now a fast operation. Also removed DAG_ids_flush_update that goes along with such manual tagging of ob->recalc. --- source/blender/collada/AnimationImporter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/collada/AnimationImporter.cpp') diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 943c4fb574d..60188071832 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -1888,7 +1888,7 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root, COLLADAFW::No job->lay = BKE_scene_base_find(scene, job)->lay = 2; mul_v3_fl(job->size, 0.5f); - job->recalc |= OB_RECALC_OB; + DAG_id_tag_update(&job->id, OB_RECALC_OB); verify_adt_action((ID *)&job->id, 1); @@ -1909,14 +1909,14 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root, COLLADAFW::No if (par_job) { job->parent = par_job; - par_job->recalc |= OB_RECALC_OB; + DAG_id_tag_update(&par_job->id, OB_RECALC_OB); job->parsubstr[0] = 0; } BKE_object_where_is_calc(scene, job); // after parenting and layer change - DAG_scene_sort(CTX_data_main(C), scene); + DAG_relations_tag_update(CTX_data_main(C)); joint_objects[node->getUniqueId()] = job; } -- cgit v1.2.3