diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2019-01-18 20:54:10 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2019-01-18 20:54:10 +0300 |
commit | b640fd829e3a228561e4d9dba9c830ae22d3ebc7 (patch) | |
tree | 431a203d22e26bb816ccc6e3990c54fc41bd3bbd /source/blender/modifiers/intern/MOD_bevel.c | |
parent | c9938ebb0064675a17c92e8112fc4d416bba5f7c (diff) |
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.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_bevel.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); |