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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-03-29 02:03:46 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-03-29 02:03:46 +0400
commitb8bb3f2e3c52186b388dedba7cc0a950adf2d0a2 (patch)
treed87c959a2a3f0c65d66fd04591952892ffdf0d02 /source/blender/bmesh/operators/bmo_removedoubles.c
parent9391e4c4a35e656373badc01457a5670e82cb2ac (diff)
Partial fix for array modifier vertex merge (bug 30195).
Two fixes: * The find-doubles operator was overriding the "dirty" element indices, so vertices were not being mapped correctly. * In some cases a vertex can be set to merge with a vertex that is also set to be merged, so added a loop to find the first unmerged vert in this case. Not yet working is the "First Last" merge option. Also made some cleanups and added comments in the array/remove doubles code.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_removedoubles.c')
-rw-r--r--source/blender/bmesh/operators/bmo_removedoubles.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index a5e4cd31f41..5bf40e6fd38 100644
--- a/source/blender/bmesh/operators/bmo_removedoubles.c
+++ b/source/blender/bmesh/operators/bmo_removedoubles.c
@@ -103,6 +103,7 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
BMFace *f, *f2;
int a, b;
+ /* mark merge verts for deletion */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if ((v2 = BMO_slot_map_ptr_get(bm, op, "targetmap", v))) {
BMO_elem_flag_enable(bm, v, ELE_DEL);
@@ -112,10 +113,12 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
}
}
+ /* check if any faces are getting their own corners merged
+ together, split face if so */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
remdoubles_splitface(f, bm, op);
}
-
+
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (BMO_elem_flag_test(bm, e->v1, ELE_DEL) || BMO_elem_flag_test(bm, e->v2, ELE_DEL)) {
v = BMO_slot_map_ptr_get(bm, op, "targetmap", e->v1);
@@ -149,6 +152,8 @@ void bmo_weldverts_exec(BMesh *bm, BMOperator *op)
}
bm->elem_index_dirty |= BM_FACE;
+ /* faces get "modified" by creating new faces here, then at the
+ end the old faces are deleted */
BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, f, FACE_MARK))
continue;