diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-03 04:08:37 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-03 04:08:37 +0300 |
commit | 0ff879af73b33985bfdb55c53ff4441f05663def (patch) | |
tree | 3ce0d3502180d6ccd80413b18c62f9a491a6817f /source/blender/blenkernel/intern | |
parent | 96b9f42c3980e75fd77d1a58bf91b55e046101e9 (diff) |
Spline IK Bugfix:
Spline IK now takes curve-object transforms into account when the 'Chain Offset' option is not enabled, since the intention of that feature is to allow a chain of bones following the shape of a curve to be placed anywhere in the scene.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index c963bf761ea..ca7d1b7e77a 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1892,6 +1892,12 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o /* tail endpoint */ if ( where_on_path(ikData->tar, tree->points[index], vec, dir, NULL, &rad) ) { + /* apply curve's object-mode transforms to the position + * unless the option to allow curve to be positioned elsewhere is activated (i.e. no root) + */ + if ((ikData->flag & CONSTRAINT_SPLINEIK_NO_ROOT) == 0) + mul_m4_v3(ikData->tar->obmat, vec); + /* convert the position to pose-space, then store it */ mul_m4_v3(ob->imat, vec); interp_v3_v3v3(poseTail, pchan->pose_tail, vec, tailBlendFac); @@ -1902,6 +1908,12 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o /* head endpoint */ if ( where_on_path(ikData->tar, tree->points[index+1], vec, dir, NULL, &rad) ) { + /* apply curve's object-mode transforms to the position + * unless the option to allow curve to be positioned elsewhere is activated (i.e. no root) + */ + if ((ikData->flag & CONSTRAINT_SPLINEIK_NO_ROOT) == 0) + mul_m4_v3(ikData->tar->obmat, vec); + /* store the position, and convert it to pose space */ mul_m4_v3(ob->imat, vec); VECCOPY(poseHead, vec); |