diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-24 10:16:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-24 10:16:44 +0400 |
commit | 1424a171a464f79073da2a00c2b5bfa66bf00bc4 (patch) | |
tree | 04b17da29ac982acc50ef2d4c5412569fa613007 /source/blender/editors/transform/transform_conversions.c | |
parent | c7ff23cc34e67e0c8f292fe19c4af4af05b15f1c (diff) |
bugfix [#21097] Rotating multiple bones with non-local location behaves incorrectly.
- rotation and bone scaling with Durian feature 'Local Location' would fail to correctly translate the bone
because a different matrix is needed for translation and rotation.
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5b1813559bb..818e5c2df66 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -554,7 +554,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr /* proper way to get parent transform + own transform + constraints transform */ copy_m3_m4(omat, ob->obmat); - if (t->mode==TFM_TRANSLATION && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) + if (ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) unit_m3(bmat); else copy_m3_m3(bmat, pchan->bone->bone_mat); @@ -585,6 +585,19 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr invert_m3_m3(td->smtx, td->mtx); + /* exceptional case: rotate the pose bone which also applies transformation + * when a parentless bone has BONE_NO_LOCAL_LOCATION [] */ + if (!ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) { + if(pchan->parent) { + /* same as td->smtx but without pchan->bone->bone_mat */ + td->flag |= TD_PBONE_LOCAL_MTX_C; + mul_m3_m3m3(td->ext->l_smtx, pchan->bone->bone_mat, td->smtx); + } + else { + td->flag |= TD_PBONE_LOCAL_MTX_P; + } + } + /* for axismat we use bone's own transform */ copy_m3_m4(pmat, pchan->pose_mat); mul_m3_m3m3(td->axismtx, omat, pmat); |