diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 07:46:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 07:46:30 +0400 |
commit | 4fe4cfdb88c83dc2d41dacb201b8a8212efc5c07 (patch) | |
tree | 620f5f3efe0df55d017786764ebf7650bb346dd0 /source/blender/bmesh/operators/bmo_edgesplit.c | |
parent | 04beeea9c9d7805b8df10c986c779f7b48a3f56f (diff) |
revert own commit r44684 it broke edges with one vertex on a boundry
Diffstat (limited to 'source/blender/bmesh/operators/bmo_edgesplit.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_edgesplit.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c index f0bdaf3c396..a390313ed36 100644 --- a/source/blender/bmesh/operators/bmo_edgesplit.c +++ b/source/blender/bmesh/operators/bmo_edgesplit.c @@ -223,7 +223,7 @@ void bmo_edgesplit_exec(BMesh *bm, BMOperator *op) BMFace *f, *f2; BMLoop *l, *l2, *l3; BMLoop *l_next, *l_prev; - BMEdge *e; + BMEdge *e, *e2; BMVert *v, *v2; /* face/vert aligned vert array */ @@ -236,32 +236,23 @@ void bmo_edgesplit_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_SEAM, BM_EDGE); - /* untag edges not connected to other tagged edges */ - { - unsigned char *vtouch; - - BM_mesh_elem_index_ensure(bm, BM_VERT); - - vtouch = MEM_callocN(sizeof(char) * bm->totvert, __func__); - - /* single marked edges unconnected to any other marked edges - * are illegal, go through and unmark them */ - BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { - /* lame, but we dont want the count to exceed 255, - * so just count to 2, its all we need */ - unsigned char *c; - c = &vtouch[BM_elem_index_get(e->v1)]; if (*c < 2) (*c)++; - c = &vtouch[BM_elem_index_get(e->v2)]; if (*c < 2) (*c)++; - } - BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { - if (vtouch[BM_elem_index_get(e->v1)] == 1 && - vtouch[BM_elem_index_get(e->v2)] == 1) - { - BMO_elem_flag_disable(bm, e, EDGE_SEAM); + /* single marked edges unconnected to any other marked edges + * are illegal, go through and unmark them */ + BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { + for (i = 0; i < 2; i++) { + BM_ITER(e2, &iter, bm, BM_EDGES_OF_VERT, i ? e->v2 : e->v1) { + if (e != e2 && BMO_elem_flag_test(bm, e2, EDGE_SEAM)) { + break; + } + } + if (e2) { + break; } } - MEM_freeN(vtouch); + if (!e2) { + BMO_elem_flag_disable(bm, e, EDGE_SEAM); + } } etags = MEM_callocN(sizeof(EdgeTag) * bm->totedge, "EdgeTag"); |