diff options
author | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
commit | 4aa2a5481cec4edc4694ee1edbde4ed3f3986313 (patch) | |
tree | 0dd39e7392e62963a2bcb7d82249e9c84e032fb2 /source/blender/bmesh/intern | |
parent | a39da2cbca19102589d5141c80a6bc013bd4c963 (diff) |
Bevel: Refactor "Vertex Only" to an enum
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 11 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.h | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 67c0fdba12b..4117ad67dd3 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1755,6 +1755,12 @@ static BMO_FlagSet bmo_enum_bevel_vmesh_method[] = { {0, NULL}, }; +static BMO_FlagSet bmo_enum_bevel_affect_type[] = { + {BEVEL_AFFECT_VERTICES, "VERTICES"}, + {BEVEL_AFFECT_EDGES, "EDGES"}, + {0, NULL}, +}; + /* * Bevel. * @@ -1768,10 +1774,11 @@ static BMOpDefine bmo_bevel_def = { {"offset_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_bevel_offset_type}, /* how to measure the offset */ {"profile_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, - bmo_enum_bevel_profile_type}, /* The profile type to use for bevel. */ + bmo_enum_bevel_profile_type}, /* The profile type to use for bevel. */ {"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 */ + {"affect", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, + bmo_enum_bevel_affect_type}, /* Whether to bevel vertices or 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 */ {"loop_slide", BMO_OP_SLOT_BOOL}, /* prefer to slide along edges to having even widths */ diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index 29fcf7ca0ca..c0e59758120 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -139,6 +139,12 @@ enum { BEVEL_VMESH_CUTOFF, }; +/* Bevel affect option. */ +enum { + BEVEL_AFFECT_VERTICES = 0, + BEVEL_AFFECT_EDGES = 1, +}; + /* Normal Face Strength values */ enum { FACE_STRENGTH_WEAK = -16384, |