From aef01c47e6334b214520f14c72b01de99387f122 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Thu, 3 Jan 2019 13:39:52 -0500 Subject: Fix T58113 Multiple problems with bevel harden normals. Move the bevel hardening code all into bmesh_bevel.c. Based on user feedback, rewrote the bevel hardening algorithm to be more what users want. Based on user feedback, changed the UI, removing some not-useful options. Now hardening normals while beveling is enabled by a simple checkbox. Now setting face strength gives options for which faces get their face strength set. --- source/blender/bmesh/intern/bmesh_opdefines.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 519ffa5ed59..7a6cb814cc9 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1734,11 +1734,11 @@ static BMO_FlagSet bmo_enum_bevel_offset_type[] = { {0, NULL}, }; -static BMO_FlagSet bmo_enum_bevel_harden_normal_type[] = { - {BEVEL_HN_NONE, "NONE"}, - {BEVEL_HN_FACE, "FACE"}, - {BEVEL_HN_ADJ, "ADJACENT"}, - {BEVEL_HN_FIX_SHA, "FIXED_NORMAL_SHADING"}, +static BMO_FlagSet bmo_enum_bevel_face_strength_type[] = { + {BEVEL_FACE_STRENGTH_NONE, "NONE"}, + {BEVEL_FACE_STRENGTH_NEW, "NEW"}, + {BEVEL_FACE_STRENGTH_AFFECTED, "AFFECTED"}, + {BEVEL_FACE_STRENGTH_ALL, "ALL"}, {0, NULL}, }; @@ -1761,15 +1761,15 @@ static BMOpDefine bmo_bevel_def = { {"loop_slide", BMO_OP_SLOT_BOOL}, /* prefer to slide along edges to having even widths */ {"mark_seam", BMO_OP_SLOT_BOOL}, /* extend edge data to allow seams to run across bevels */ {"mark_sharp", BMO_OP_SLOT_BOOL}, /* extend edge data to allow sharp edges to run across bevels */ - {"strength", BMO_OP_SLOT_FLT}, /* strength of calculated normal in range (0, 1) for custom clnors */ - {"hnmode", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_bevel_harden_normal_type}, /* harden normals mode used in bevel, if enabled */ + {"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 */ {{'\0'}}, }, /* slots_out */ {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ - {"normals.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL}}, /* output normals per vertex for beveled edges */ {{'\0'}}, }, -- cgit v1.2.3