diff options
Diffstat (limited to 'source/blender/editors/transform/transform_manipulator.c')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 396cb15e61a..1bf3bab2616 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -56,6 +56,7 @@ #include "BKE_mesh.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_tessmesh.h" #include "BLI_math.h" #include "BLI_editVert.h" @@ -264,20 +265,22 @@ int calc_manipulator_stats(const bContext *C) if((ob->lay & v3d->lay)==0) return 0; if(obedit->type==OB_MESH) { - EditMesh *em = BKE_mesh_get_editmesh(obedit->data); - EditVert *eve; - EditSelection ese; + BMEditMesh *em = ((Mesh*)obedit->data)->edit_btmesh; + BMesh *bm = em->bm; + BMVert *eve; + BMEditSelection ese; + BMIter iter; float vec[3]= {0,0,0}; /* USE LAST SELECTE WITH ACTIVE */ - if (v3d->around==V3D_ACTIVE && EM_get_actSelection(em, &ese)) { - EM_editselection_center(vec, &ese); + if (v3d->around==V3D_ACTIVE && EDBM_get_actSelection(em, &ese)) { + EDBM_editselection_center(em, vec, &ese); calc_tw_center(scene, vec); totsel= 1; } else { /* do vertices for center, and if still no normal found, use vertex normals */ - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { + BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) { + if(BM_TestHFlag(eve, BM_SELECT)) { totsel++; calc_tw_center(scene, eve->co); } @@ -478,7 +481,7 @@ int calc_manipulator_stats(const bContext *C) case V3D_MANIP_GIMBAL: { - float mat[3][3]; + float mat[3][3]; if (gimbal_axis(ob, mat)) { copy_m4_m3(rv3d->twmat, mat); break; @@ -490,8 +493,8 @@ int calc_manipulator_stats(const bContext *C) float mat[3][3]; ED_getTransformOrientationMatrix(C, mat, (v3d->around == V3D_ACTIVE)); copy_m4_m3(rv3d->twmat, mat); - break; - } + break; + } /* no break we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: copy_m4_m4(rv3d->twmat, ob->obmat); @@ -894,12 +897,12 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, glBegin(GL_LINES); glVertex3f(0.0f, 0.0f, 0.2f); glVertex3f(0.0f, 0.0f, 1.0f); - glEnd(); + glEnd(); postOrtho(ortho); - } } } } + } if(arcs==0 && moving) { |