diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2015-01-06 17:12:40 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2015-01-06 17:13:38 +0300 |
commit | bf168f0600ceaa7b82b09f4cd369cc4c831f98f5 (patch) | |
tree | 0283952467e8a0b97f43fefbfdae3e4d9dd2a0d5 /source/blender/bmesh | |
parent | 22c9979b51602427d0b1a1ab48498d8ab3d9dd52 (diff) |
Fix T43137: vertex bevel percent mode wasn't implemented.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index c3d1ca86fbf..81236b4ac73 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -1474,7 +1474,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct) return; } - lastd = bp->vertex_only ? bv->offset : e->offset_l; + lastd = e->offset_l; do { if (e->is_bev) { /* handle only left side of beveled edge e here: next iteration should do right side */ @@ -1557,9 +1557,10 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct) /* None of e->prev, e, e->next are beveled. * could either leave alone or add slide points to make * one polygon around bv->v. For now, we choose latter. + * For vertex bevel, we use e->offset_l as slide distance. * Could slide to make an even bevel plane but for now will * just use last distance a meet point moved from bv->v. */ - slide_dist(e, bv->v, lastd, co); + slide_dist(e, bv->v, bp->vertex_only ? e->offset_l : lastd, co); if (construct) { v = add_new_bound_vert(mem_arena, vm, co); v->efirst = v->elast = e; @@ -3078,6 +3079,18 @@ static BevVert *bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v) e->offset_r_spec *= weight; } } + else if (bp->vertex_only) { + /* Weight has already been applied to bv->offset, if present. + * Transfer to e->offset_[lr]_spec and treat percet as special case */ + if (bp->offset_type == BEVEL_AMT_PERCENT) { + v2 = BM_edge_other_vert(e->e, bv->v); + e->offset_l_spec = BM_edge_calc_length(e->e) * bv->offset / 100.0f; + } + else { + e->offset_l_spec = bv->offset; + } + e->offset_r_spec = e->offset_l_spec; + } else { e->offset_l_spec = e->offset_r_spec = 0.0f; } |