diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-26 10:59:59 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-26 10:59:59 +0400 |
commit | cf2c459325a31b4a40f7abb24dc16c67016d75ad (patch) | |
tree | 11005f13d592ca77a93986c16ad82b7081da2460 /source/blender/bmesh/operators/bmo_subdivide.c | |
parent | 7ecf0542956523391ea94084664fdf5c8365aa3b (diff) |
Fix #33285: loop cut is not supposed to cut through triangles/ngons, but it
still happened when the loop would go all the way around the mesh with just one
triangle/ngon inbetween to close the loop.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_subdivide.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index f9b6611c88b..74972da8888 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -715,7 +715,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BMFace *face; BLI_array_declare(verts); float smooth, fractal, along_normal; - int use_sphere, cornertype, use_singleedge, use_gridfill; + int use_sphere, cornertype, use_singleedge, use_gridfill, use_onlyquads; int skey, seed, i, j, matched, a, b, numcuts, totesel; BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, SUBD_SPLIT); @@ -729,6 +729,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) use_singleedge = BMO_slot_bool_get(op->slots_in, "use_singleedge"); use_gridfill = BMO_slot_bool_get(op->slots_in, "use_gridfill"); + use_onlyquads = BMO_slot_bool_get(op->slots_in, "use_onlyquads"); use_sphere = BMO_slot_bool_get(op->slots_in, "use_sphere"); BLI_srandom(seed); @@ -804,6 +805,10 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) BMEdge *e1 = NULL, *e2 = NULL; float vec1[3], vec2[3]; + /* skip non-quads if requested */ + if(use_onlyquads && face->len != 4) + continue; + /* figure out which pattern to use */ BLI_array_empty(edges); @@ -1089,6 +1094,7 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag, int numcuts, int seltype, int cornertype, const short use_singleedge, const short use_gridfill, + const short use_onlyquads, int seed) { BMOperator op; @@ -1100,12 +1106,14 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag, "cuts=%i " "quad_corner_type=%i " "use_singleedge=%b use_gridfill=%b " + "use_onlyquads=%b " "seed=%i", edge_hflag, smooth, fractal, along_normal, numcuts, cornertype, use_singleedge, use_gridfill, + use_onlyquads, seed); BMO_op_exec(bm, &op); |