diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-11-14 00:44:32 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-11-14 00:44:32 +0300 |
commit | e76f7e793064f72557a8148b8c8cbf748cdaf152 (patch) | |
tree | a4b1ce7514ff2c95d021b0ad2878a2585549636d /source | |
parent | c838ee9592582397b12955131737bd2c9739b712 (diff) |
Normal Orientation on EditBones uses roll for Z axis.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/transform_orientations.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/src/transform_orientations.c b/source/blender/src/transform_orientations.c index fc9dfbb902e..0bc1ef5ca1f 100644 --- a/source/blender/src/transform_orientations.c +++ b/source/blender/src/transform_orientations.c @@ -40,6 +40,7 @@ #include "BKE_global.h" #include "BKE_utildefines.h" +#include "BKE_armature.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -680,21 +681,20 @@ int getTransformOrientation(float normal[3], float plane[3], int activeOnly) { if (ebone->flag & BONE_SELECTED) { + float mat[3][3]; float vec[3]; VecSubf(vec, ebone->tail, ebone->head); Normalize(vec); VecAddf(normal, normal, vec); + + vec_roll_to_mat3(vec, ebone->roll, mat); + VecAddf(plane, plane, mat[2]); } } } Normalize(normal); - Crossf(plane, G.obedit->obmat[0], normal); - - if (Inpf(plane, plane) < FLT_EPSILON) - { - Crossf(plane, G.obedit->obmat[1], normal); - } + Normalize(plane); if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0) { |