Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-06-23 05:25:55 +0300
committerHans Goudey <h.goudey@me.com>2020-06-23 05:25:55 +0300
commit6703c7f7f1f68ae59f9ccbf4fcabc3c035d648bf (patch)
treebf5def93b54ba810bbaef693ecc79d81e97e635b /source/blender/bmesh/intern/bmesh_opdefines.c
parent716a8241d387180fd8ad69cdec33633bc7a0f963 (diff)
Bevel: Refactor profile type input to use an enum
This will allow the easier addition of a constant radius mode in the future and some changes in the UI to mirror the recent similar change from "Only Vertices" to the "Affect" enum.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_opdefines.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index ca34cd7d7e5..67c0fdba12b 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1728,6 +1728,12 @@ static BMO_FlagSet bmo_enum_bevel_offset_type[] = {
{0, NULL},
};
+static BMO_FlagSet bmo_enum_bevel_profile_type[] = {
+ {BEVEL_PROFILE_SUPERELLIPSE, "SUPERELLIPSE"},
+ {BEVEL_PROFILE_CUSTOM, "CUSTOM"},
+ {0, NULL},
+};
+
static BMO_FlagSet bmo_enum_bevel_face_strength_type[] = {
{BEVEL_FACE_STRENGTH_NONE, "NONE"},
{BEVEL_FACE_STRENGTH_NEW, "NEW"},
@@ -1760,7 +1766,9 @@ static BMOpDefine bmo_bevel_def = {
{{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */
{"offset", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */
{"offset_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM},
- bmo_enum_bevel_offset_type}, /* how to measure the offset */
+ 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. */
{"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 */
@@ -1778,9 +1786,7 @@ static BMOpDefine bmo_bevel_def = {
bmo_enum_bevel_miter_type}, /* outer miter kind */
{"spread", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */
{"smoothresh", BMO_OP_SLOT_FLT}, /* for passing mesh's smoothresh, used in hardening */
- {"use_custom_profile", BMO_OP_SLOT_BOOL}, /* Whether to use custom profile feature */
- /* the ProfileWiget struct for the custom profile shape */
- {"custom_profile", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_STRUCT}},
+ {"custom_profile", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_STRUCT}}, /* CurveProfile */
{"vmesh_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM},
bmo_enum_bevel_vmesh_method},
{{'\0'}},