https://svn.blender.org/svnroot/bf-blender/trunk/blender, in sync with trunk now
[blender.git] / source / blender / editors / transform / transform_generics.c
index c81c398e6961c3a84269944f6c67e16e89875043..d5ff475566e3170ba4c32fa66ae8406aefedec8f 100644 (file)
@@ -72,6 +72,7 @@
 #include "BKE_mesh.h"
 #include "BKE_nla.h"
 #include "BKE_context.h"
+#include "BKE_tessmesh.h"
 
 #include "ED_anim_api.h"
 #include "ED_armature.h"
@@ -232,10 +233,10 @@ static void clipMirrorModifier(TransInfo *t, Object *ob)
 }
 
 /* assumes obedit set to mesh object */
-static void editmesh_apply_to_mirror(TransInfo *t)
+static void editbmesh_apply_to_mirror(TransInfo *t)
 {
        TransData *td = t->data;
-       EditVert *eve;
+       BMVert *eve;
        int i;
        
        for(i = 0 ; i < t->total; i++, td++) {
@@ -672,7 +673,7 @@ void recalcData(TransInfo *t)
                                if(la->editlatt->latt->flag & LT_OUTSIDE) outside_lattice(la->editlatt->latt);
                        }
                        else if (t->obedit->type == OB_MESH) {
-                               EditMesh *em = ((Mesh*)t->obedit->data)->edit_mesh;
+                               BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh;
                                /* mirror modifier clipping? */
                                if(t->state != TRANS_CANCEL) {
                                        /* apply clipping after so we never project past the clip plane [#25423] */
@@ -680,11 +681,12 @@ void recalcData(TransInfo *t)
                                        clipMirrorModifier(t, t->obedit);
                                }
                                if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR))
-                                       editmesh_apply_to_mirror(t);
+                                       editbmesh_apply_to_mirror(t);
                                        
                                DAG_id_tag_update(t->obedit->data, 0);  /* sets recalc flags */
                                
-                               recalc_editnormals(em);
+                               EDBM_RecalcNormals(em);
+                               BMEdit_RecalcTesselation(em);
                        }
                        else if(t->obedit->type==OB_ARMATURE) { /* no recalc flag, does pose */
                                bArmature *arm= t->obedit->data;
@@ -1461,13 +1463,13 @@ void calculateCenter(TransInfo *t)
                /* EDIT MODE ACTIVE EDITMODE ELEMENT */
 
                if (t->obedit && t->obedit->type == OB_MESH) {
-                       EditSelection ese;
-                       EditMesh *em = BKE_mesh_get_editmesh(t->obedit->data);
+                       BMEditSelection ese;
+                       BMEditMesh *em = ((Mesh*)t->obedit->data)->edit_btmesh;
                        
-                       if (EM_get_actSelection(em, &ese)) {
-                               EM_editselection_center(t->center, &ese);
-                               calculateCenter2D(t);
-                               break;
+                       if (EDBM_get_actSelection(em, &ese)) {
+                       EDBM_editselection_center(em, t->center, &ese);
+                       calculateCenter2D(t);
+                       break;
                        }
                } /* END EDIT MODE ACTIVE ELEMENT */