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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-08 18:01:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-08 18:01:38 +0400
commit7dbf6d513e785f2b3101b555c983a19245c94620 (patch)
tree72e92954e52a1186b709cd9057f4258b95f1448e /source/blender/bmesh/operators/bmo_dissolve.c
parent8193d83cd99a56709609e41f1f4eb28db8aa2d29 (diff)
mesh dissolve vertices: option to split off corners of surrounding faces, makes the result more localized to the area around the vertex.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_dissolve.c')
-rw-r--r--source/blender/bmesh/operators/bmo_dissolve.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index e2a3cf025aa..3023071175a 100644
--- a/source/blender/bmesh/operators/bmo_dissolve.c
+++ b/source/blender/bmesh/operators/bmo_dissolve.c
@@ -359,10 +359,32 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
BMIter iter, fiter;
BMVert *v;
BMFace *f;
- /* int i; */
+
+ const bool use_face_split = BMO_slot_bool_get(op->slots_in, "use_face_split");
+
BMO_slot_buffer_flag_enable(bm, op->slots_in, "verts", BM_VERT, VERT_MARK);
+ if (use_face_split) {
+ BMIter liter;
+ BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+ if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
+ if (BM_vert_edge_count(v) > 2) {
+ BMLoop *l;
+ BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
+ if (l->f->len > 3) {
+ if (BMO_elem_flag_test(bm, l->next->v, VERT_MARK) == 0 &&
+ BMO_elem_flag_test(bm, l->prev->v, VERT_MARK) == 0)
+ {
+ BM_face_split(bm, l->f, l->next->v, l->prev->v, NULL, NULL, true);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
for (v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); v; v = BM_iter_step(&iter)) {
if (BMO_elem_flag_test(bm, v, VERT_MARK)) {
/* check if it's a two-valence ver */