From ba1e9ae4733ae956331c7e8899f6939997205298 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 20 Nov 2019 16:12:32 -0500 Subject: Bevel: Custom Profile and CurveProfile Widget Custom profiles in bevel allows the profile curve to be controlled by manually placed control points. Orientation is regularized along groups of edges, and the 'pipe case' is updated. This commit includes many updates to comments and changed variable names as well. A 'cutoff' vertex mesh method is added to bevel in addition to the existing grid fill option for replacing vertices. The UI of the bevel modifier and tool are updated and unified. Also, a 'CurveProfile' widget is added to BKE for defining the profile in the interface, which may be useful in other situations. Many thanks to Howard, my mentor for this GSoC project. Reviewers: howardt, campbellbarton Differential Revision: https://developer.blender.org/D5516 --- source/blender/bmesh/intern/bmesh_opdefines.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source/blender/bmesh/intern/bmesh_opdefines.c') diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 7086cea1ace..74d01dca66a 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1725,6 +1725,12 @@ static BMO_FlagSet bmo_enum_bevel_miter_type[] = { {0, NULL}, }; +static BMO_FlagSet bmo_enum_bevel_vmesh_method[] = { + {BEVEL_VMESH_ADJ, "ADJ"}, + {BEVEL_VMESH_CUTOFF, "CUTOFF"}, + {0, NULL}, +}; + /* * Bevel. * @@ -1735,7 +1741,8 @@ static BMOpDefine bmo_bevel_def = { /* slots_in */ {{"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 */ + {"offset_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, + bmo_enum_bevel_offset_type}, /* how to measure the offset */ {"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 */ @@ -1746,13 +1753,18 @@ static BMOpDefine bmo_bevel_def = { {"mark_sharp", BMO_OP_SLOT_BOOL}, /* extend edge data to allow sharp edges to run across bevels */ {"harden_normals", BMO_OP_SLOT_BOOL}, /* harden normals */ {"face_strength_mode", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, - bmo_enum_bevel_face_strength_type}, /* whether to set face strength, and which faces to set if so */ + bmo_enum_bevel_face_strength_type}, /* whether to set face strength, and which faces to set if so */ {"miter_outer", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, - bmo_enum_bevel_miter_type}, /* outer miter kind */ + bmo_enum_bevel_miter_type}, /* outer miter kind */ {"miter_inner", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, - bmo_enum_bevel_miter_type}, /* outer miter kind */ + 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}}, + {"vmesh_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, + bmo_enum_bevel_vmesh_method}, {{'\0'}}, }, /* slots_out */ -- cgit v1.2.3