diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-26 04:43:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-26 04:43:47 +0400 |
commit | ebeb8155777269ea70f5c0c9de898bdd01d87715 (patch) | |
tree | 14a95b14fa8f3321ec794db58daa3055deafcedb | |
parent | 76acda4417e8575122b0a225c2ebe2503cd9132b (diff) |
fix for vertex dissolve not doing anything with a single vertex on a single face.
now collapse the vertex into the edges.
also disable removing the vertrex when it could not be collapsed (old code), found it could would connected faces which isn't acceptable - now return fail in that case.
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index e182a72f456..471a9f3965f 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -72,20 +72,22 @@ int BM_vert_dissolve(BMesh *bm, BMVert *v) } else if (!v->e->l) { if (len == 2) { - BM_vert_collapse_edge(bm, v->e, v); + return (BM_vert_collapse_edge(bm, v->e, v) != NULL); } else { - /* this may be too harsh, we could do nothing here instead. - * To test, connect 3 edges to a vert and dissolve the vert. It will be removed */ - - BM_vert_kill(bm, v); /* will kill edges too */ + /* used to kill the vertex here, but it may be connected to faces. + * so better do nothing */ + return FALSE; } - return TRUE; } else { return FALSE; } } + else if (len == 2 && BM_vert_face_count(v) == 1) { + /* boundry vertex on a face */ + return (BM_vert_collapse_edge(bm, v->e, v) != NULL); + } else { return BM_disk_dissolve(bm, v); } |