From a62b806d70a8d4f9dacaa55aa32e9b00fee654e2 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 8 Oct 2014 16:41:00 +0200 Subject: Fix T42145: EditMesh Bevel tools had no clamping option. Missing feature already present in Bevel modifier, useful and rather simple to add. --- source/blender/bmesh/operators/bmo_bevel.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source/blender/bmesh/operators/bmo_bevel.c') diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 213a0830e63..864c4dada6d 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -35,12 +35,13 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) { - const float offset = BMO_slot_float_get(op->slots_in, "offset"); - const int offset_type = BMO_slot_int_get(op->slots_in, "offset_type"); - const int seg = BMO_slot_int_get(op->slots_in, "segments"); - const bool vonly = BMO_slot_bool_get(op->slots_in, "vertex_only"); - const float profile = BMO_slot_float_get(op->slots_in, "profile"); - const int material = BMO_slot_int_get(op->slots_in, "material"); + const float offset = BMO_slot_float_get(op->slots_in, "offset"); + const int offset_type = BMO_slot_int_get(op->slots_in, "offset_type"); + const int seg = BMO_slot_int_get(op->slots_in, "segments"); + const bool vonly = BMO_slot_bool_get(op->slots_in, "vertex_only"); + const float profile = BMO_slot_float_get(op->slots_in, "profile"); + const bool clamp_overlap = BMO_slot_bool_get(op->slots_in, "clamp_overlap"); + const int material = BMO_slot_int_get(op->slots_in, "material"); if (offset > 0) { BMOIter siter; @@ -61,7 +62,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } } - BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, false, NULL, -1, material); + BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material); BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "faces.out", BM_FACE, BM_ELEM_TAG); } -- cgit v1.2.3 From 12aff8d783b6d9e9507dbd8747d8e343c2c526ec Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Sun, 5 Jul 2015 09:53:17 -0400 Subject: Add 'loop slide' option to bevel. See T45260 Current behavior of bevel is to 'loop slide' along unbeveled edges when possible, but this produces uneven bevel widths sometimes, so this option lets user choose between having the loop slide effect or having more even bevel widths. Trying it out with default being 'no loop slide', so different from current behavior. May reverse this choice later, depending on user reactions. --- source/blender/bmesh/operators/bmo_bevel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/bmesh/operators/bmo_bevel.c') diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 864c4dada6d..d5afb39d7b7 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -42,6 +42,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) const float profile = BMO_slot_float_get(op->slots_in, "profile"); const bool clamp_overlap = BMO_slot_bool_get(op->slots_in, "clamp_overlap"); const int material = BMO_slot_int_get(op->slots_in, "material"); + const bool loop_slide = BMO_slot_bool_get(op->slots_in, "loop_slide"); if (offset > 0) { BMOIter siter; @@ -62,7 +63,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) } } - BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material); + BM_mesh_bevel(bm, offset, offset_type, seg, profile, vonly, false, clamp_overlap, NULL, -1, material, loop_slide); BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "faces.out", BM_FACE, BM_ELEM_TAG); } -- cgit v1.2.3