diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 07:20:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 07:20:40 +0300 |
commit | 21c75bc7c560b65c1ed6fe2a7ba05d3fb59dadc6 (patch) | |
tree | 236bd61236c735890a0936ff59b7983a1664735f /source/blender/editors/gpencil/gpencil_data.c | |
parent | 21589dcbe01809de5c3bb4ec294a7dc3c3cf8c4e (diff) |
GP: replace custom API w/ BKE_deform API
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 006e2679c8c..d7e58609d2d 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -1764,10 +1764,8 @@ static int gpencil_vertex_group_smooth_exec(bContext *C, wmOperator *op) ptc = &gps->points[i]; } - float wa = BKE_gpencil_vgroup_use_index(dverta, def_nr); - float wb = BKE_gpencil_vgroup_use_index(dvertb, def_nr); - CLAMP_MIN(wa, 0.0f); - CLAMP_MIN(wb, 0.0f); + float wa = defvert_find_weight(dverta, def_nr); + float wb = defvert_find_weight(dvertb, def_nr); /* the optimal value is the corresponding to the interpolation of the weight * at the distance of point b @@ -1775,8 +1773,10 @@ static int gpencil_vertex_group_smooth_exec(bContext *C, wmOperator *op) const float opfac = line_point_factor_v3(&ptb->x, &pta->x, &ptc->x); const float optimal = interpf(wa, wb, opfac); /* Based on influence factor, blend between original and optimal */ - wb = interpf(wb, optimal, fac); - BKE_gpencil_vgroup_add_point_weight(dvertb, def_nr, wb); + MDeformWeight *dw = defvert_verify_index(dvertb, def_nr); + if (dw) { + dw->weight = interpf(wb, optimal, fac); + } } } } |