Fix #137385: Grease Pencil: Thickness modifier doesn't work with vgroup filter

Use `get_influence_vertex_weights` for thickness modifier. This returns
array of values 0 when group is empty (see `lookup_or_default`).
Function also controls the invert state for vertex group.

Pull Request: https://projects.blender.org/blender/blender/pulls/137455
This commit is contained in:
Pratik Borhade
2025-04-14 10:20:49 +02:00
committed by Pratik Borhade
parent b4028ee28f
commit 062c5ab225

View File

@@ -104,8 +104,8 @@ static void deform_drawing(const ModifierData &md,
MutableSpan<float> radii = drawing.radii_for_write();
const OffsetIndices points_by_curve = curves.points_by_curve();
bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
const VArray<float> vgroup_weights = *attributes.lookup_or_default<float>(
mmd.influence.vertex_group_name, bke::AttrDomain::Point, 1.0f);
const VArray<float> vgroup_weights = modifier::greasepencil::get_influence_vertex_weights(
curves, mmd.influence);
const bool is_normalized = (mmd.flag & MOD_GREASE_PENCIL_THICK_NORMALIZE) != 0;
const bool is_inverted = ((mmd.flag & MOD_GREASE_PENCIL_THICK_WEIGHT_FACTOR) == 0) &&
((mmd.influence.flag & GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP) !=