Depsgraph: Ensure root pchan is always found
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 4 Apr 2018 09:49:01 +0000 (11:49 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 4 Apr 2018 09:49:01 +0000 (11:49 +0200)
source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc

index b9a53c69070c2df9cd621e215b5afcbfec61db68..4e1de16235c3d63a5f226a0c157de1f1f271e8e5 100644 (file)
@@ -98,6 +98,7 @@ void DepsgraphNodeBuilder::build_ik_pose(Object *object,
        }
 
        int rootchan_index = BLI_findindex(&object->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,
@@ -122,6 +123,7 @@ 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);
+       BLI_assert(rootchan_index != -1);
        add_operation_node(&object->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name,
                           function_bind(BKE_pose_splineik_evaluate,
                                         _1,