diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 16:27:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 16:27:19 +0300 |
commit | f5d64b59f5152114cfa25a2b7433ed25204cb149 (patch) | |
tree | 94edee55c57c284bd36f241dab28cf01128d2fa4 /source/blender/blenkernel | |
parent | bf8137994d12b68523dad83991bb624dc0d0ab31 (diff) |
Fix T53691: Motion Tracking Object Solver Constraint doesn't work as Bone Constraint
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 63ac479dc93..149158b9f5d 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -506,7 +506,8 @@ static bool build_deg_tracking_constraints(DagForest *dag, DagNode *scenenode, bConstraint *con, const bConstraintTypeInfo *cti, - DagNode *node) + DagNode *node, + bool is_data) { if (!ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, @@ -522,7 +523,11 @@ static bool build_deg_tracking_constraints(DagForest *dag, } if (data->depth_ob != NULL) { DagNode *node2 = dag_get_node(dag, data->depth_ob); - dag_add_relation(dag, node2, node, DAG_RL_DATA_OB | DAG_RL_OB_OB, cti->name); + dag_add_relation(dag, + node2, node, + (is_data) ? (DAG_RL_DATA_DATA | DAG_RL_OB_DATA) + : (DAG_RL_DATA_OB | DAG_RL_OB_OB), + cti->name); } } else if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) { @@ -530,7 +535,11 @@ static bool build_deg_tracking_constraints(DagForest *dag, } if (depends_on_camera && scene->camera != NULL) { DagNode *node2 = dag_get_node(dag, scene->camera); - dag_add_relation(dag, node2, node, DAG_RL_DATA_OB | DAG_RL_OB_OB, cti->name); + dag_add_relation(dag, + node2, node, + (is_data) ? (DAG_RL_DATA_DATA | DAG_RL_OB_DATA) + : (DAG_RL_DATA_OB | DAG_RL_OB_OB), + cti->name); } dag_add_relation(dag, scenenode, node, DAG_RL_SCENE, "Scene Relation"); return true; @@ -571,7 +580,10 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc continue; } - if (cti->get_constraint_targets) { + if (build_deg_tracking_constraints(dag, scene, scenenode, con, cti, node, true)) { + /* pass */ + } + else if (cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); for (ct = targets.first; ct; ct = ct->next) { @@ -882,7 +894,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc continue; /* special case for camera tracking -- it doesn't use targets to define relations */ - if (build_deg_tracking_constraints(dag, scene, scenenode, con, cti, node)) { + if (build_deg_tracking_constraints(dag, scene, scenenode, con, cti, node, false)) { addtoroot = 0; } else if (cti->get_constraint_targets) { |