merge with 2.5 (not trunk, last merge message said that on accident) at r22252
[blender.git] / source / blender / editors / space_view3d / view3d_header.c
index 26ca5a07973a345fe22213f47b697850c905822a..2bc9b96281e749f3e7ab9d414f48c857bd8b18d0 100644 (file)
@@ -64,6 +64,7 @@
 #include "BKE_particle.h"
 #include "BKE_screen.h"
 #include "BKE_utildefines.h" /* for VECCOPY */
+#include "BKE_tessmesh.h"
 
 #include "ED_armature.h"
 #include "ED_particle.h"
@@ -3508,11 +3509,11 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
        Base *basact= CTX_data_active_base(C);
        Object *ob= CTX_data_active_object(C);
        Object *obedit = CTX_data_edit_object(C);
-       EditMesh *em= NULL;
+       BMEditMesh *em= NULL;
        int bit, ctrl= win->eventstate->ctrl, shift= win->eventstate->shift;
        
        if(obedit && obedit->type==OB_MESH) {
-               em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+               em= ((Mesh *)obedit->data)->edit_btmesh;
        }
        /* watch it: if sa->win does not exist, check that when calling direct drawing routines */
 
@@ -3638,7 +3639,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
                        if(shift==0 || em->selectmode==0)
                                em->selectmode= SCE_SELECT_VERTEX;
                        ts->selectmode= em->selectmode;
-                       EM_selectmode_set(em);
+                       EDBM_selectmode_set(em);
                        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
                        ED_undo_push(C, "Selectmode Set: Vertex");
                }
@@ -3647,12 +3648,12 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
                if(em) {
                        if(shift==0 || em->selectmode==0){
                                if( (em->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX){
-                                       if(ctrl) EM_convertsel(em, SCE_SELECT_VERTEX,SCE_SELECT_EDGE); 
+                                       if(ctrl) EDBM_convertsel(em, SCE_SELECT_VERTEX,SCE_SELECT_EDGE); 
                                }
                                em->selectmode = SCE_SELECT_EDGE;
                        }
                        ts->selectmode= em->selectmode;
-                       EM_selectmode_set(em);
+                       EDBM_selectmode_set(em);
                        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
                        ED_undo_push(C, "Selectmode Set: Edge");
                }
@@ -3661,12 +3662,12 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
                if(em) {
                        if( shift==0 || em->selectmode==0){
                                if( ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)){
-                                       if(ctrl) EM_convertsel(em, (ts->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE);
+                                       if(ctrl) EDBM_convertsel(em, (ts->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE);
                                }
                                em->selectmode = SCE_SELECT_FACE;
                        }
                        ts->selectmode= em->selectmode;
-                       EM_selectmode_set(em);
+                       EDBM_selectmode_set(em);
                        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
                        ED_undo_push(C, "Selectmode Set: Face");
                }
@@ -3749,9 +3750,6 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event)
                }
                break;
        }
-
-       if(obedit && obedit->type==OB_MESH)
-               BKE_mesh_end_editmesh(obedit->data, em);
 }
 
 static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *ob, int *xcoord, int yco)
@@ -4118,7 +4116,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
 
                /* selection modus */
                if(obedit && (obedit->type == OB_MESH)) {
-                       EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+                       BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
 
                        uiBlockBeginAlign(block);
                        uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, xco,yco,XIC,YIC, &em->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)");
@@ -4134,8 +4132,6 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                        }
                        uiBlockEndAlign(block);
                        header_xco_step(ar, &xco, &yco, &maxco, XIC);
-
-                       BKE_mesh_end_editmesh(obedit->data, em);
                }
                else if(G.f & G_PARTICLEEDIT) {
                        uiBlockBeginAlign(block);