From b640fd829e3a228561e4d9dba9c830ae22d3ebc7 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Fri, 18 Jan 2019 12:54:10 -0500 Subject: Add miter pattern options. Will document the new options in release notes, then in manual. Still a bit of work to do on the bulging shape that appears on cube corners if using arc inner miters, but will do that later. Also need to do something smarter in clamp overlap. --- source/blender/modifiers/intern/MOD_bevel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_bevel.c') diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 05015492158..568cdcf6707 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -67,6 +67,9 @@ static void initData(ModifierData *md) bmd->e_flags = 0; bmd->edge_flags = 0; bmd->face_str_mode = MOD_BEVEL_FACE_STRENGTH_NONE; + bmd->miter_inner = MOD_BEVEL_MITER_SHARP; + bmd->miter_outer = MOD_BEVEL_MITER_SHARP; + bmd->spread = 0.1f; bmd->mat = -1; bmd->profile = 0.5f; bmd->bevel_angle = DEG2RADF(30.0f); @@ -119,6 +122,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes const bool mark_sharp = (bmd->edge_flags & MOD_BEVEL_MARK_SHARP); bool harden_normals = (bmd->flags & MOD_BEVEL_HARDEN_NORMALS); const int face_strength_mode = bmd->face_str_mode; + const int miter_outer = bmd->miter_outer; + const int miter_inner = bmd->miter_inner; + const float spread = bmd->spread; bm = BKE_mesh_to_bmesh_ex( mesh, @@ -196,7 +202,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes BM_mesh_bevel(bm, value, offset_type, bmd->res, bmd->profile, vertex_only, bmd->lim_flags & MOD_BEVEL_WEIGHT, do_clamp, dvert, vgroup, mat, loop_slide, mark_seam, mark_sharp, - harden_normals, face_strength_mode, mesh->smoothresh); + harden_normals, face_strength_mode, + miter_outer, miter_inner, spread, mesh->smoothresh); result = BKE_mesh_from_bmesh_for_eval_nomain(bm, 0); -- cgit v1.2.3