editmesh accessor functions. most editmesh access now goes through:
[blender.git] / source / blender / editors / space_image / image_header.c
index ef59252dbc72fcd6629ce13ed2ae19b6bdb6bcd3..80ace5500b83755fc679cb3503f4a1b8ae687a2e 100644 (file)
@@ -381,7 +381,7 @@ static void image_uvsmenu(bContext *C, uiMenuItem *head, void *arg_unused)
 static void image_menu_uvlayers(Object *obedit, char *menustr, int *active)
 {
        Mesh *me= (Mesh*)obedit->data;
-       EditMesh *em= me->edit_mesh;
+       EditMesh *em= EM_GetEditMesh(me);
        CustomDataLayer *layer;
        int i, count = 0;
 
@@ -397,6 +397,8 @@ static void image_menu_uvlayers(Object *obedit, char *menustr, int *active)
        }
 
        *active= CustomData_get_active_layer(&em->fdata, CD_MTFACE);
+
+       EM_EndEditMesh(me, em);
 }
 
 static void do_image_buttons(bContext *C, void *arg, int event)