diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-08 18:41:00 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-08 18:42:41 +0400 |
commit | a62b806d70a8d4f9dacaa55aa32e9b00fee654e2 (patch) | |
tree | f1a29bf8074c8eedeef00a8bd6890a4a0565d3d6 /source/blender/bmesh | |
parent | 67943af47a8ded8fab73141f7e03f140bbe80b55 (diff) |
Fix T42145: EditMesh Bevel tools had no clamping option.
Missing feature already present in Bevel modifier, useful and rather simple to add.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 3 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_bevel.c | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index e2be90e7baf..aba805cccd7 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1676,7 +1676,8 @@ static BMOpDefine bmo_bevel_def = { {"offset_type", BMO_OP_SLOT_INT}, /* how to measure offset (enum) */ {"segments", BMO_OP_SLOT_INT}, /* number of segments in bevel */ {"profile", BMO_OP_SLOT_FLT}, /* profile shape, 0->1 (.5=>round) */ - {"vertex_only", BMO_OP_SLOT_BOOL}, /* only bevel vertices, not edges */ + {"vertex_only", BMO_OP_SLOT_BOOL}, /* only bevel vertices, not edges */ + {"clamp_overlap", BMO_OP_SLOT_BOOL}, /* do not allow beveled edges/vertices to overlap each other */ {"material", BMO_OP_SLOT_INT}, /* material for bevel faces, -1 means get from adjacent faces */ {{'\0'}}, }, 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); } |