editmesh accessor functions. most editmesh access now goes through:
[blender.git] / source / blender / editors / space_image / image_panels.c
index 9f6a379ff2b263e4547804536898e52f62ffa0a1..b6da7415f1fbc97e4aea2381c2b2ac8bfa3df917 100644 (file)
@@ -249,7 +249,7 @@ static void image_editvertex_buts(const bContext *C, uiBlock *block)
        
        image_transform_but_attr(sima, &imx, &imy, &step, &digits);
        
-       em= ((Mesh *)obedit->data)->edit_mesh;
+       em= EM_GetEditMesh((Mesh *)obedit->data);
        for (efa= em->faces.first; efa; efa= efa->next) {
                tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
                if (simaFaceDraw_Check(efa, tf)) {
@@ -338,6 +338,8 @@ static void image_editvertex_buts(const bContext *C, uiBlock *block)
                
                WM_event_add_notifier(C, NC_IMAGE, sima->image);
        }
+
+       EM_EndEditMesh(obedit->data, em);
 }
 
 
@@ -441,7 +443,7 @@ static void image_panel_view_properties(const bContext *C, ARegion *ar)
        
        if (obedit && obedit->type==OB_MESH) {
                Mesh *me= obedit->data;
-               EditMesh *em= me->edit_mesh;
+               EditMesh *em= EM_GetEditMesh(me);
                
                if(EM_texFaceCheck(em)) {
                        uiDefBut(block, LABEL, B_NOP, "Draw Type:",             10, 80,120,19, 0, 0, 0, 0, 0, "");
@@ -469,7 +471,8 @@ static void image_panel_view_properties(const bContext *C, ARegion *ar)
                                uiBlockEndAlign(block);
                        }
                }
-               
+
+               EM_EndEditMesh(me, em);
        }
        image_editcursor_buts(C, &ar->v2d, block);
 }