From 84be763be299572eb98a7fbf3b87c27408c57984 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 25 Aug 2016 15:51:19 +0200 Subject: Depsgraph: Merge some traversal back on After previous commit there is no longer measurable difference in speed and doing all stuff in one go is preferrable here anyway. --- .../depsgraph/intern/eval/deg_eval_flush.cc | 82 ++++++++++------------ 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 98d8c60f012..a7418ac2c11 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -136,6 +136,42 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) ComponentDepsNode *comp_node = node->owner; IDDepsNode *id_node = comp_node->owner; + + ID *id = id_node->id; + if(id_node->done == 0) { + deg_editors_id_update(bmain, id); + lib_id_recalc_tag(bmain, id); + /* TODO(sergey): For until we've got proper data nodes in the graph. */ + lib_id_recalc_data_tag(bmain, id); + } + + if(comp_node->done == 0) { + Object *object = NULL; + if (GS(id->name) == ID_OB) { + object = (Object *)id; + } + foreach (OperationDepsNode *op, comp_node->operations) { + op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; + } + if (object != NULL) { + /* This code is used to preserve those areas which does + * direct object update, + * + * Plus it ensures visibility changes and relations and + * layers visibility update has proper flags to work with. + */ + if (comp_node->type == DEPSNODE_TYPE_ANIMATION) { + object->recalc |= OB_RECALC_TIME; + } + else if (comp_node->type == DEPSNODE_TYPE_TRANSFORM) { + object->recalc |= OB_RECALC_OB; + } + else { + object->recalc |= OB_RECALC_DATA; + } + } + } + id_node->done = 1; comp_node->done = 1; @@ -162,52 +198,6 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) } } } - - GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash) - { - if (id_node->done == 1) { - ID *id = id_node->id; - Object *object = NULL; - - if (GS(id->name) == ID_OB) { - object = (Object *)id; - } - - deg_editors_id_update(bmain, id_node->id); - - lib_id_recalc_tag(bmain, id_node->id); - /* TODO(sergey): For until we've got proper data nodes in the graph. */ - lib_id_recalc_data_tag(bmain, id_node->id); - - GHASH_FOREACH_BEGIN(const ComponentDepsNode *, comp_node, id_node->components) - { - if (comp_node->done) { - foreach (OperationDepsNode *op, comp_node->operations) { - op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; - } - if (object != NULL) { - /* This code is used to preserve those areas which does - * direct object update, - * - * Plus it ensures visibility changes and relations and - * layers visibility update has proper flags to work with. - */ - if (comp_node->type == DEPSNODE_TYPE_ANIMATION) { - object->recalc |= OB_RECALC_TIME; - } - else if (comp_node->type == DEPSNODE_TYPE_TRANSFORM) { - object->recalc |= OB_RECALC_OB; - } - else { - object->recalc |= OB_RECALC_DATA; - } - } - } - } - GHASH_FOREACH_END(); - } - } - GHASH_FOREACH_END(); } static void graph_clear_func(void *data_v, int i) -- cgit v1.2.3