From 6d8f63a8343a6c0b44318f0a856dcd0fd0206131 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Oct 2017 22:20:34 +1100 Subject: Fix T53054: Parentless bone + IK crashes --- source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | 3 +++ source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc | 3 +++ 2 files changed, 6 insertions(+) (limited to 'source/blender') 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 ceb2fd25f94..f99be191529 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -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)) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index ca548ed33d0..bde3c0fae10 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -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); -- cgit v1.2.3