Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-02-26 04:43:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-02-26 04:43:47 +0400
commitebeb8155777269ea70f5c0c9de898bdd01d87715 (patch)
tree14a95b14fa8f3321ec794db58daa3055deafcedb /source
parent76acda4417e8575122b0a225c2ebe2503cd9132b (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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c14
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);
}