diff options
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_header.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_panels.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 26 |
3 files changed, 30 insertions, 9 deletions
diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index ef59252dbc7..80ace5500b8 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -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) diff --git a/source/blender/editors/space_image/image_panels.c b/source/blender/editors/space_image/image_panels.c index 9f6a379ff2b..b6da7415f1f 100644 --- a/source/blender/editors/space_image/image_panels.c +++ b/source/blender/editors/space_image/image_panels.c @@ -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); } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index bfe2f778c9b..db8bdbdacc8 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -255,7 +255,7 @@ static void image_refresh(const bContext *C, ScrArea *sa) if(ima && (ima->source==IMA_SRC_VIEWER || sima->pin)); else if(obedit && obedit->type == OB_MESH) { Mesh *me= (Mesh*)obedit->data; - EditMesh *em= me->edit_mesh; + EditMesh *em= EM_GetEditMesh(me); MTFace *tf; if(em && EM_texFaceCheck(em)) { @@ -278,6 +278,8 @@ static void image_refresh(const bContext *C, ScrArea *sa) } } } + + EM_EndEditMesh(obedit->data, em); } } @@ -755,8 +757,15 @@ int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit) if(ED_space_image_show_paint(sima)) return 0; - if(obedit && obedit->type == OB_MESH) - return EM_texFaceCheck(((Mesh*)obedit->data)->edit_mesh); + if(obedit && obedit->type == OB_MESH) { + EditMesh *em = EM_GetEditMesh(obedit->data); + int ret; + + ret = EM_texFaceCheck(em); + + EM_EndEditMesh(obedit->data, em); + return ret; + } return 0; } @@ -767,8 +776,15 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit) return 0; if(ED_space_image_show_paint(sima)) - if(obedit && obedit->type == OB_MESH) - return EM_texFaceCheck(((Mesh*)obedit->data)->edit_mesh); + if(obedit && obedit->type == OB_MESH) { + EditMesh *em = EM_GetEditMesh(obedit->data); + int ret; + + ret = EM_texFaceCheck(em); + + EM_EndEditMesh(obedit->data, em); + return ret; + } return 0; } |