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.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.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index a43078e5d6a..dbeee4fddbd 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2916,9 +2916,19 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short sub_v3_v3v3(vec, vec, td->center); // Translation needed from the initial location - mul_m3_v3(pmtx, vec); // To Global space - mul_m3_v3(td->smtx, vec);// To Pose space - + /* special exception, see TD_PBONE_LOCAL_MTX definition comments */ + if(td->flag & TD_PBONE_LOCAL_MTX_P) { + /* do nothing */ + } + else if (td->flag & TD_PBONE_LOCAL_MTX_C) { + mul_m3_v3(pmtx, vec); // To Global space + mul_m3_v3(td->ext->l_smtx, vec);// To Pose space (Local Location) + } + else { + mul_m3_v3(pmtx, vec); // To Global space + mul_m3_v3(td->smtx, vec);// To Pose space + } + protectedTransBits(td->protectflag, vec); add_v3_v3v3(td->loc, td->iloc, vec); |