diff --git a/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc b/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc index c11a53a44fd..86497d2e335 100644 --- a/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc +++ b/source/blender/modifiers/intern/MOD_grease_pencil_envelope.cc @@ -482,16 +482,17 @@ static void create_envelope_strokes_for_curve(const EnvelopeInfo &info, * Each span only gets added once since it repeats for neighboring points. */ - for (const int i : IndexRange(num_strokes)) { - const IndexRange dst_envelope_points = {i * info.points_per_curve, info.points_per_curve}; + for (const int dst_i : IndexRange(num_strokes)) { + const int src_i = dst_i * (1 + info.skip); + const IndexRange dst_envelope_points = {dst_i * info.points_per_curve, info.points_per_curve}; - curve_offsets[i] = dst_points[dst_envelope_points.start()]; - material_indices[i] = info.material_index >= 0 ? info.material_index : + curve_offsets[dst_i] = dst_points[dst_envelope_points.start()]; + material_indices[dst_i] = info.material_index >= 0 ? info.material_index : src_material_indices[src_curve_index]; create_envelope_stroke_for_point(src_curve_points, src_curve_cyclic, - i, + src_i, spread, base_length, point_src_indices.slice(dst_envelope_points));