From 21c75bc7c560b65c1ed6fe2a7ba05d3fb59dadc6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Aug 2018 14:20:40 +1000 Subject: GP: replace custom API w/ BKE_deform API --- source/blender/editors/gpencil/gpencil_data.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/gpencil/gpencil_data.c') 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); + } } } } -- cgit v1.2.3