diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 02:36:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-13 02:36:46 +0400 |
commit | 4a8d4f319f9a68c0006460861a01066a5c35921a (patch) | |
tree | 5618cbef42626704330ffa4d0da66df345e14074 /source | |
parent | c2a8f43e35a2bd754a50e54daf34f1b146f5c8f6 (diff) |
bmesh_edge_separate: avoid counting radial loops when splitting edges, we only need to check if the edge is boundary or not. will speedup edgesplit modifier a little.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 13 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.h | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 8d3c47d2cd1..36ef8ad6f60 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -2114,18 +2114,19 @@ bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target) * \note Does nothing if \a l_sep is already the only loop in the * edge radial. */ -bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep) +void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep) { BMEdge *e_new; - int radlen; +#ifndef NDEBUG + const int radlen = bmesh_radial_length(e->l); +#endif BLI_assert(l_sep->e == e); BLI_assert(e->l); - radlen = bmesh_radial_length(e->l); - if (radlen < 2) { + if (BM_edge_is_boundary(e)) { /* no cut required */ - return true; + return; } if (l_sep == e->l) { @@ -2142,8 +2143,6 @@ bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep) BM_CHECK_ELEMENT(e_new); BM_CHECK_ELEMENT(e); - - return true; } /** diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h index 6e691a9a0b5..b091a4d6437 100644 --- a/source/blender/bmesh/intern/bmesh_core.h +++ b/source/blender/bmesh/intern/bmesh_core.h @@ -50,7 +50,7 @@ void BM_face_kill(BMesh *bm, BMFace *f); void BM_edge_kill(BMesh *bm, BMEdge *e); void BM_vert_kill(BMesh *bm, BMVert *v); -bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep); +void bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep); bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target); bool BM_vert_splice(BMesh *bm, BMVert *v, BMVert *v_target); |