Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/src/transform_orientations.c')
-rw-r--r--source/blender/src/transform_orientations.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/src/transform_orientations.c b/source/blender/src/transform_orientations.c
index 9c7a2f67b89..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"
@@ -352,7 +353,7 @@ char * BIF_menustringTransformOrientation(char *title) {
char *str_menu, *p;
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 40 * BIF_countTransformOrientation(), "UserTransSpace from matrix");
+ str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(), "UserTransSpace from matrix");
p = str_menu;
p += sprintf(str_menu, "%s", title);
@@ -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)
{