diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 09:02:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 09:05:57 +0300 |
commit | 34c97a1b003143bb79e8b08dec339b9ad13a17f6 (patch) | |
tree | e2fa91198e41e883ef1993ad4fbb985b492969df /source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c | |
parent | 21c75bc7c560b65c1ed6fe2a7ba05d3fb59dadc6 (diff) |
Cleanup: rename 'vindex' to 'def_nr'
Name hinted 'vertex index', where it's the index of the vertex group.
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c index b5f2f0349af..d6a0721129d 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c @@ -67,9 +67,7 @@ static void deformStroke( Object *ob, bGPDlayer *gpl, bGPDstroke *gps) { SmoothGpencilModifierData *mmd = (SmoothGpencilModifierData *)md; - int vindex = defgroup_name_index(ob, mmd->vgname); - float weight = 1.0f; - float val; + const int def_nr = defgroup_name_index(ob, mmd->vgname); if (!is_stroke_affected_by_modifier(ob, mmd->layername, mmd->pass_index, 3, gpl, gps, @@ -86,12 +84,13 @@ static void deformStroke( MDeformVert *dvert = &gps->dvert[i]; /* verify vertex group */ - weight = get_modifier_point_weight(dvert, (int)((mmd->flag & GP_SMOOTH_INVERT_VGROUP) != 0), vindex); - if (weight < 0) { + const float weight = get_modifier_point_weight( + dvert, (mmd->flag & GP_SMOOTH_INVERT_VGROUP) != 0, def_nr); + if (weight < 0.0f) { continue; } - val = mmd->factor * weight; + const float val = mmd->factor * weight; /* perform smoothing */ if (mmd->flag & GP_SMOOTH_MOD_LOCATION) { BKE_gpencil_smooth_stroke(gps, i, val); @@ -99,7 +98,7 @@ static void deformStroke( if (mmd->flag & GP_SMOOTH_MOD_STRENGTH) { BKE_gpencil_smooth_stroke_strength(gps, i, val); } - if ((mmd->flag & GP_SMOOTH_MOD_THICKNESS) && (val > 0)) { + if ((mmd->flag & GP_SMOOTH_MOD_THICKNESS) && (val > 0.0f)) { /* thickness need to repeat process several times */ for (int r2 = 0; r2 < r * 10; r2++) { BKE_gpencil_smooth_stroke_thickness(gps, i, val); |