diff options
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c index 33bdb9c861d..55836dce1cd 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c @@ -79,8 +79,7 @@ static void deformStroke( Object *ob, bGPDlayer *gpl, bGPDstroke *gps) { LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md; - int vindex = defgroup_name_index(ob, mmd->vgname); - float weight = 1.0f; + 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, @@ -98,11 +97,10 @@ static void deformStroke( MDeformVert *dvert = &gps->dvert[i]; /* verify vertex group */ - weight = get_modifier_point_weight(dvert, (int)((mmd->flag & GP_LATTICE_INVERT_VGROUP) != 0), vindex); - if (weight < 0) { + const float weight = get_modifier_point_weight(dvert, (mmd->flag & GP_LATTICE_INVERT_VGROUP) != 0, def_nr); + if (weight < 0.0f) { continue; } - calc_latt_deform((struct LatticeDeformData *)mmd->cache_data, &pt->x, mmd->strength * weight); } } |