diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-09 22:17:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-09 22:17:33 +0300 |
commit | a15180669891dcb4f0a4dff891e8a129b3788776 (patch) | |
tree | 3907a8c7a4dc3afc3289e57dba93e0fbf9514fd9 /source/blender/depsgraph/intern | |
parent | 10d57f991b06ae7c0a0b5e492eec8c7163debf80 (diff) | |
parent | d733826708f9b562687b78424e5c0835cba8c3c9 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/depsgraph/intern')
4 files changed, 57 insertions, 58 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index ced53bdf2e4..cd150b2b70e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1181,11 +1181,12 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob, OperationKey done_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); add_relation(solver_key, done_key, DEPSREL_TYPE_TRANSFORM, "IK Chain Result"); + } else { + OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); + add_relation(solver_key, final_transforms_key, DEPSREL_TYPE_TRANSFORM, "IK Solver Result"); } parchan->flag |= POSE_DONE; - OperationKey final_transforms_key(&ob->id, DEPSNODE_TYPE_BONE, parchan->name, DEG_OPCODE_BONE_DONE); - add_relation(solver_key, final_transforms_key, DEPSREL_TYPE_TRANSFORM, "IK Solver Result"); root_map->add_bone(parchan->name, rootchan->name); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 30d243867b0..fda665b0db4 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -80,11 +80,12 @@ static void flush_init_func(void *data_v, int i) */ Depsgraph *graph = (Depsgraph *)data_v; OperationDepsNode *node = graph->operations[i]; - IDDepsNode *id_node = node->owner->owner; + ComponentDepsNode *comp_node = node->owner; + IDDepsNode *id_node = comp_node->owner; id_node->done = 0; + comp_node->done = 0; node->scheduled = false; - node->owner->flags &= ~DEPSCOMP_FULLY_SCHEDULED; - if (node->owner->type == DEPSNODE_TYPE_PROXY) { + if (comp_node->type == DEPSNODE_TYPE_PROXY) { node->flag |= DEPSOP_FLAG_NEEDS_UPDATE; } } @@ -136,49 +137,10 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) for (;;) { node->flag |= DEPSOP_FLAG_NEEDS_UPDATE; - IDDepsNode *id_node = node->owner->owner; - - if (id_node->done == 0) { - deg_editors_id_update(bmain, id_node->id); - id_node->done = 1; - } - - 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); - - ID *id = id_node->id; - /* 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 (GS(id->name) == ID_OB) { - Object *object = (Object *)id; - ComponentDepsNode *comp_node = node->owner; - 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; - } - } - - /* TODO(sergey): For until incremental updates are possible - * witin a component at least we tag the whole component - * for update. - */ - ComponentDepsNode *component = node->owner; - if ((component->flags & DEPSCOMP_FULLY_SCHEDULED) == 0) { - foreach (OperationDepsNode *op, component->operations) { - op->flag |= DEPSOP_FLAG_NEEDS_UPDATE; - } - component->flags |= DEPSCOMP_FULLY_SCHEDULED; - } + ComponentDepsNode *comp_node = node->owner; + IDDepsNode *id_node = comp_node->owner; + id_node->done = 1; + comp_node->done = 1; /* Flush to nodes along links... */ if (node->outlinks.size() == 1) { @@ -203,6 +165,52 @@ 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) diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 7e49fec051f..8e74317cfa2 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -86,7 +86,6 @@ static void comp_node_hash_value_free(void *value_v) ComponentDepsNode::ComponentDepsNode() : entry_operation(NULL), exit_operation(NULL), - flags(0), layers(0) { operations_map = BLI_ghash_new(comp_node_hash_key, diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index df321ea9299..6ff4345d28b 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -47,13 +47,6 @@ struct Depsgraph; struct OperationDepsNode; struct BoneComponentDepsNode; -typedef enum eDepsComponent_Flag { - /* Temporary flags, meaning all the component's operations has been - * scheduled for update. - */ - DEPSCOMP_FULLY_SCHEDULED = 1, -} eDepsComponent_Flag; - /* ID Component - Base type for all components */ struct ComponentDepsNode : public DepsNode { /* Key used to look up operations within a component */ @@ -165,8 +158,6 @@ struct ComponentDepsNode : public DepsNode { // XXX: a poll() callback to check if component's first node can be started? - int flags; - /* Temporary bitmask, used during graph construction. */ int layers; }; |