diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 14:03:03 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 14:03:03 +0400 |
commit | 084aa7aedb33dbd86a98ac1e089933851ba2954b (patch) | |
tree | 435d06aee4a19b5cc73f1544a2c34a1d9cd98671 /source/blender/editors/mesh/editmesh_loop.c | |
parent | a083d7c5b5d8b04588e6ae8fd0c40254df536a43 (diff) | |
parent | 89b906db9f758fb9642e01d9b4433b97557369fb (diff) |
merge with 2.5 at r19462
Diffstat (limited to 'source/blender/editors/mesh/editmesh_loop.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_loop.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 7afa5e1bceb..dcec73eebc2 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -782,8 +782,8 @@ static float bm_seg_intersect(BMEdge *e, CutCurve *c, int len, char mode, static int knife_cut_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); - EditMesh *em= ((Mesh *)obedit->data)->edit_mesh, *em2; BMesh *bm; + EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)), *em2; ARegion *ar= CTX_wm_region(C); BMVert *bv; BMIter iter; @@ -798,6 +798,7 @@ static int knife_cut_exec(bContext *C, wmOperator *op) if (EM_nvertices_selected(em) < 2) { error("No edges are selected to operate on"); + EM_EndEditMesh(obedit->data, em); return OPERATOR_CANCELLED;; } @@ -810,8 +811,11 @@ static int knife_cut_exec(bContext *C, wmOperator *op) } RNA_END; - if(len<2) return OPERATOR_CANCELLED; - + if(len<2) { + EM_EndEditMesh(obedit->data, em); + return OPERATOR_CANCELLED; + } + bm = editmesh_to_bmesh(em); /*the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer*/ @@ -872,7 +876,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op) MEM_freeN(em2); BM_Free_Mesh(bm); - + + EM_EndEditMesh(obedit->data, em); return OPERATOR_FINISHED; } |