Fix T53054: Parentless bone + IK crashes

This commit is contained in:
Campbell Barton 2017-10-16 22:20:34 +11:00
parent 8550c2b922
commit 6d8f63a834
Notes: blender-bot 2023-02-14 06:28:56 +01:00
Referenced by issue #53683, 2.79a release
Referenced by issue #53054, Bones No Parent+Not Tail = Crash
2 changed files with 6 additions and 0 deletions

View File

@ -79,6 +79,9 @@ void DepsgraphNodeBuilder::build_ik_pose(Scene *scene, Object *ob, bPoseChannel
/* Find the chain's root. */
bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
if (rootchan == NULL) {
return;
}
if (has_operation_node(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name,
DEG_OPCODE_POSE_IK_SOLVER))

View File

@ -83,6 +83,9 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
* - see notes on direction of rel below...
*/
bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
if (rootchan == NULL) {
return;
}
OperationKey pchan_local_key(&ob->id, DEG_NODE_TYPE_BONE,
pchan->name, DEG_OPCODE_BONE_LOCAL);
OperationKey init_ik_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT_IK);