diff options
author | Ish Bosamiya <ishbosamiya> | 2019-03-22 19:55:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-22 20:11:14 +0300 |
commit | da5b6ed75bf08141dd19a0cc143d1a91b14a0f24 (patch) | |
tree | 761250222839c8c9800de88329d153a5ce7daf10 /source/blender/bmesh/tools/bmesh_triangulate.c | |
parent | c89dcc89e6ebc3882f66b3536a51bae83807ad6b (diff) |
Modifiers: add minimum number of vertices to triangulate modifier.
This lets you only triangulate n-gons when setting the number to 5 or more.
Differential Revision: https://developer.blender.org/D4367
Diffstat (limited to 'source/blender/bmesh/tools/bmesh_triangulate.c')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_triangulate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/bmesh/tools/bmesh_triangulate.c b/source/blender/bmesh/tools/bmesh_triangulate.c index 034151fa584..9be4e8f621c 100644 --- a/source/blender/bmesh/tools/bmesh_triangulate.c +++ b/source/blender/bmesh/tools/bmesh_triangulate.c @@ -83,8 +83,9 @@ static void bm_face_triangulate_mapping( void BM_mesh_triangulate( - BMesh *bm, const int quad_method, const int ngon_method, const bool tag_only, - BMOperator *op, BMOpSlot *slot_facemap_out, BMOpSlot *slot_facemap_double_out) + BMesh *bm, const int quad_method, const int ngon_method, const int min_vertices, + const bool tag_only, BMOperator *op, BMOpSlot *slot_facemap_out, + BMOpSlot *slot_facemap_double_out) { BMIter iter; BMFace *face; @@ -103,7 +104,7 @@ void BM_mesh_triangulate( if (slot_facemap_out) { /* same as below but call: bm_face_triangulate_mapping() */ BM_ITER_MESH (face, &iter, bm, BM_FACES_OF_MESH) { - if (face->len > 3) { + if (face->len >= min_vertices) { if (tag_only == false || BM_elem_flag_test(face, BM_ELEM_TAG)) { bm_face_triangulate_mapping( bm, face, @@ -118,7 +119,7 @@ void BM_mesh_triangulate( LinkNode *faces_double = NULL; BM_ITER_MESH (face, &iter, bm, BM_FACES_OF_MESH) { - if (face->len > 3) { + if (face->len >= min_vertices) { if (tag_only == false || BM_elem_flag_test(face, BM_ELEM_TAG)) { BM_face_triangulate( bm, face, |