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/editors/transform/transform_orientations.c')
-rw-r--r--source/blender/editors/transform/transform_orientations.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index d509ce97015..210ab0d45a8 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -34,7 +34,6 @@
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
-#include "BKE_global.h"
#include "BKE_utildefines.h"
#include "BKE_armature.h"
#include "BKE_context.h"
@@ -51,6 +50,7 @@
#include "ED_armature.h"
#include "ED_mesh.h"
+#include "ED_curve.h" /* for ED_curve_editnurbs */
#include "RNA_define.h"
@@ -517,6 +517,7 @@ void initTransformOrientation(bContext *C, TransInfo *t)
case V3D_MANIP_GIMBAL:
unit_m3(t->spacemtx);
if (gimbal_axis(ob, t->spacemtx)) {
+ strcpy(t->spacename, "gimbal");
break;
}
/* no gimbal fallthrough to normal */
@@ -725,7 +726,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
for (eve = em->verts.first; eve; eve = eve->next)
{
if ( eve->f & SELECT ) {
- add_v3_v3v3(normal, normal, eve->no);
+ add_v3_v3(normal, eve->no);
}
}
normalize_v3(normal);
@@ -739,8 +740,9 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
Nurb *nu;
BezTriple *bezt;
int a;
-
- for (nu = cu->editnurb->first; nu; nu = nu->next)
+ ListBase *nurbs= ED_curve_editnurbs(cu);
+
+ for (nu = nurbs->first; nu; nu = nu->next)
{
/* only bezier has a normal */
if(nu->type == CU_BEZIER)
@@ -832,10 +834,10 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
float vec[3];
sub_v3_v3v3(vec, ebone->tail, ebone->head);
normalize_v3(vec);
- add_v3_v3v3(normal, normal, vec);
+ add_v3_v3(normal, vec);
vec_roll_to_mat3(vec, ebone->roll, mat);
- add_v3_v3v3(plane, plane, mat[2]);
+ add_v3_v3(plane, mat[2]);
}
}
}
@@ -875,8 +877,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
/* use channels to get stats */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (pchan->bone && pchan->bone->flag & BONE_TRANSFORM) {
- add_v3_v3v3(normal, normal, pchan->pose_mat[2]);
- add_v3_v3v3(plane, plane, pchan->pose_mat[1]);
+ add_v3_v3(normal, pchan->pose_mat[2]);
+ add_v3_v3(plane, pchan->pose_mat[1]);
}
}
negate_v3(plane);