From 948f4e8c943e2fb3ef9f9211965f9cdf1db9ed3d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 4 Apr 2018 11:55:06 +0200 Subject: 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. --- .../blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc') 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); } -- cgit v1.2.3