diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 12:55:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 12:55:06 +0300 |
commit | 948f4e8c943e2fb3ef9f9211965f9cdf1db9ed3d (patch) | |
tree | 8f032e56e1c0f40385ad9b28d5e3bbc134e64168 /source/blender | |
parent | a6999a869ef1db4a758d946564fa001dcaf60f37 (diff) |
Depsgraph: Get pchan index from correct pose
This code should be replaced with evaluation-time ID block expansion,
but before that it will be helpful to get old design to work again.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | 10 |
1 files changed, 6 insertions, 4 deletions
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 8a2cab2d0fb..4600bfedf28 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -85,6 +85,7 @@ void DepsgraphNodeBuilder::build_ik_pose(Object *object, bPoseChannel *pchan, bConstraint *con) { + Object *object_cow = get_cow_datablock(object); bKinematicConstraint *data = (bKinematicConstraint *)con->data; /* Find the chain's root. */ @@ -99,14 +100,14 @@ void DepsgraphNodeBuilder::build_ik_pose(Object *object, return; } - int rootchan_index = BLI_findindex(&object->pose->chanbase, rootchan); + int rootchan_index = BLI_findindex(&object_cow->pose->chanbase, rootchan); BLI_assert(rootchan_index != -1); /* Operation node for evaluating/running IK Solver. */ add_operation_node(&object->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, function_bind(BKE_pose_iktree_evaluate, _1, get_cow_datablock(scene_), - get_cow_datablock(object), + object_cow, rootchan_index), DEG_OPCODE_POSE_IK_SOLVER); } @@ -116,6 +117,7 @@ void DepsgraphNodeBuilder::build_splineik_pose(Object *object, bPoseChannel *pchan, bConstraint *con) { + Object *object_cow = get_cow_datablock(object); bSplineIKConstraint *data = (bSplineIKConstraint *)con->data; /* Find the chain's root. */ @@ -125,13 +127,13 @@ void DepsgraphNodeBuilder::build_splineik_pose(Object *object, * Store the "root bone" of this chain in the solver, so it knows where to * start. */ - int rootchan_index = BLI_findindex(&object->pose->chanbase, rootchan); + int rootchan_index = BLI_findindex(&object_cow->pose->chanbase, rootchan); BLI_assert(rootchan_index != -1); add_operation_node(&object->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, function_bind(BKE_pose_splineik_evaluate, _1, get_cow_datablock(scene_), - get_cow_datablock(object), + object_cow, rootchan_index), DEG_OPCODE_POSE_SPLINE_IK_SOLVER); } |