Commit: a72daea36eb1585c5e4d7b6911381c53b480b055
Author: Sergey Sharybin
Date:   Thu Jun 1 16:04:35 2017 +0200
Branches: master
https://developer.blender.org/rBa72daea36eb1585c5e4d7b6911381c53b480b055

Depsgraph: use explicit marking of component entry/exit operations

This isn't used too often, and haivng such API will let us to skip
specifying operation type for all oeprations.

===================================================================

M       source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M       source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
M       source/blender/depsgraph/intern/nodes/deg_node_component.cc
M       source/blender/depsgraph/intern/nodes/deg_node_component.h
M       source/blender/depsgraph/intern/nodes/deg_node_operation.cc
M       source/blender/depsgraph/intern/nodes/deg_node_operation.h

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 3330795d053..78d0b2b323e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -446,10 +446,13 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, 
Base *base, Object *ob)
 
 void DepsgraphNodeBuilder::build_object_transform(Scene *scene, Object *ob)
 {
+       OperationDepsNode *op_node;
+
        /* local transforms (from transform channels - loc/rot/scale + deltas) 
*/
-       add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
+       op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
                           DEPSOP_TYPE_INIT, 
function_bind(BKE_object_eval_local_transform, _1, scene, ob),
                           DEG_OPCODE_TRANSFORM_LOCAL);
+       op_node->set_as_entry();
 
        /* object parent */
        if (ob->parent) {
@@ -475,9 +478,10 @@ void DepsgraphNodeBuilder::build_object_transform(Scene 
*scene, Object *ob)
                           DEG_OPCODE_OBJECT_UBEREVAL);
 
        /* object transform is done */
-       add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
+       op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
                           DEPSOP_TYPE_POST, 
function_bind(BKE_object_eval_done, _1, ob),
                           DEG_OPCODE_TRANSFORM_FINAL);
+       op_node->set_as_exit();
 }
 
 /**
@@ -735,18 +739,20 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key)
 void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 {
        ID *obdata = (ID *)ob->data;
+       OperationDepsNode *op_node;
 
        /* TODO(sergey): This way using this object's properties as driver 
target
         * works fine.
         *
         * Does this depend on other nodes?
         */
-       add_operation_node(&ob->id,
+       op_node = add_operation_node(&ob->id,
                           DEG_NODE_TYPE_PARAMETERS,
                           DEPSOP_TYPE_POST,
                           NULL,
                           DEG_OPCODE_PLACEHOLDER,
                           "Parameters Eval");
+       op_node->set_as_exit();
 
        /* Temporary uber-update node, which does everything.
         * It is for the being we're porting old dependencies into the new 
system.
@@ -755,18 +761,20 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene 
*scene, Object *ob)
         *
         * TODO(sergey): Get rid of this node.
         */
-       add_operation_node(&ob->id,
+       op_node = add_operation_node(&ob->id,
                           DEG_NODE_TYPE_GEOMETRY,
                           DEPSOP_TYPE_POST,
                           function_bind(BKE_object_eval_uber_data, _1, scene, 
ob),
                           DEG_OPCODE_GEOMETRY_UBEREVAL);
+       op_node->set_as_exit();
 
-       add_operation_node(&ob->id,
+       op_node = add_operation_node(&ob->id,
                           DEG_NODE_TYPE_GEOMETRY,
                           DEPSOP_TYPE_INIT,
                           NULL,
                           DEG_OPCODE_PLACEHOLDER,
                           "Eval Init");
+       op_node->set_as_entry();
 
        // TODO: "Done" operation
 
@@ -821,7 +829,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                        //Mesh *me = (Mesh *)ob->data;
 
                        /* evaluation operations */
-                       add_operation_node(obdata,
+                       op_node = add_operation_node(obdata,
                                           DEG_NODE_TYPE_GEOMETRY,
                                           DEPSOP_TYPE_INIT,
                                           function_bind(BKE_mesh_eval_geometry,
@@ -829,6 +837,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                                                         (Mesh *)obdata),
                                           DEG_OPCODE_PLACEHOLDER,
                                           "Geometry Eval");
+                       op_node->set_as_entry();
                        break;
                }
 
@@ -840,7 +849,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                        if (mom == ob) {
                                /* metaball evaluation operations */
                                /* NOTE: only the motherball gets evaluated! */
-                               add_operation_node(obdata,
+                               op_node = add_operation_node(obdata,
                                                   DEG_NODE_TYPE_GEOMETRY,
                                                   DEPSOP_TYPE_INIT,
                                                   
function_bind(BKE_mball_eval_geometry,
@@ -848,6 +857,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                                                                 (MetaBall 
*)obdata),
                                                   DEG_OPCODE_PLACEHOLDER,
                                                   "Geometry Eval");
+                               op_node->set_as_entry();
                        }
                        break;
                }
@@ -858,7 +868,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                {
                        /* Curve/nurms evaluation operations. */
                        /* - calculate curve geometry (including path) */
-                       add_operation_node(obdata,
+                       op_node = add_operation_node(obdata,
                                           DEG_NODE_TYPE_GEOMETRY,
                                           DEPSOP_TYPE_INIT,
                                           
function_bind(BKE_curve_eval_geometry,
@@ -866,6 +876,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                                                         (Curve *)obdata),
                                           DEG_OPCODE_PLACEHOLDER,
                                           "Geometry Eval");
+                       op_node->set_as_entry();
 
                        /* Calculate curve path - this is used by constraints, 
etc. */
                        if (ELEM(ob->type, OB_CURVE, OB_FONT)) {
@@ -898,7 +909,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, 
Object *ob)
                case OB_LATTICE:
                {
                        /* Lattice evaluation operations. */
-                       add_operation_node(obdata,
+                       op_node = add_operation_node(obdata,
                                           DEG_NODE_TYPE_GEOMETRY,
                                           DEPSOP_TYPE_INIT,
                                           
function_bind(BKE_lattice_eval_geometry,
@@ -906,13 +917,15 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene 
*scene, Object *ob)
                                                         (Lattice *)obdata),
                                           DEG_OPCODE_PLACEHOLDER,
                                           "Geometry Eval");
+                       op_node->set_as_entry();
                        break;
                }
        }
 
-       add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY,
+       op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY,
                           DEPSOP_TYPE_POST, NULL,
                           DEG_OPCODE_PLACEHOLDER, "Eval Done");
+       op_node->set_as_exit();
 
        /* Parameters for driver sources. */
        add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, DEPSOP_TYPE_EXEC, 
NULL,
@@ -977,12 +990,14 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree 
*ntree)
 
        /* nodetree itself */
        ID *ntree_id = &ntree->id;
+       OperationDepsNode *op_node;
 
        build_animdata(ntree_id);
 
        /* Parameters for drivers. */
-       add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, 
DEPSOP_TYPE_POST, NULL,
+       op_node = add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, 
DEPSOP_TYPE_POST, NULL,
                           DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
+       op_node->set_as_exit();
 
        /* nodetree's nodes... */
        LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
index 29d80290bd3..00b9ef8bf6a 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
@@ -113,6 +113,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Scene 
*scene, Object *ob, bPoseCh
 void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
 {
        bArmature *arm = (bArmature *)ob->data;
+       OperationDepsNode *op_node;
 
        /* animation and/or drivers linking posebones to base-armature used to 
define them
         * NOTE: AnimData here is really used to control animated deform 
properties,
@@ -175,18 +176,21 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object 
*ob)
         */
 
        /* pose eval context */
-       add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE,
+       op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE,
                           DEPSOP_TYPE_INIT, function_bind(BKE_pose_eval_init, 
_1, scene, ob, ob->pose), DEG_OPCODE_POSE_INIT);
+       op_node->set_as_entry();
 
-       add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE,
+       op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE,
                           DEPSOP_TYPE_POST, function_bind(BKE_pose_eval_flush, 
_1, scene, ob, ob->pose), DEG_OPCODE_POSE_DONE);
+       op_node->set_as_exit();
 
        /* bones */
        LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
                /* node for bone eval */
-               add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name,
+               op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, 
pchan->name,
                                   DEPSOP_TYPE_INIT, NULL, // XXX: 
BKE_pose_eval_bone_local
                                   DEG_OPCODE_BONE_LOCAL);
+               op_node->set_as_entry();
 
                add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name,
                                   DEPSOP_TYPE_EXEC, 
function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: 
BKE_pose_eval_bone_pose
@@ -196,9 +200,10 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object 
*ob)
                                   DEPSOP_TYPE_OUT, NULL, /* NOTE: dedicated 
noop for easier relationship construction */
                                   DEG_OPCODE_BONE_READY);
 
-               add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name,
+               op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, 
pchan->name,
                                   DEPSOP_TYPE_POST, 
function_bind(BKE_pose_bone_done, _1, pchan),
                                   DEG_OPCODE_BONE_DONE);
+               op_node->set_as_exit();
 
                /* constraints */
                if (pchan->constraints.first != NULL) {
@@ -236,6 +241,8 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object 
*ob)
 void DepsgraphNodeBuilder::build_proxy_rig(Object *ob)
 {
        ID *obdata = (ID *)ob->data;
+       OperationDepsNode *op_node;
+
        build_animdata(obdata);
 
        BLI_assert(ob->pose != NULL);
@@ -246,31 +253,35 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *ob)
                BKE_pose_update_constraint_flags(ob->pose);
        }
 
-       add_operation_node(&ob->id,
+       op_node = add_operation_node(&ob->id,
                           DEG_NODE_TYPE_EVAL_POSE,
                           DEPSOP_TYPE_INIT,
                           function_bind(BKE_pose_eval_proxy_copy, _1, ob),
                           DEG_OPCODE_POSE_INIT);
+       op_node->set_as_entry();
 
        LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
-               add_operation_node(&ob->id, DEG_NODE_TYPE_BONE, pchan->name,
+               op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_BON

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to