Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c13
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);