Fix #129051: GPv3: Write default u_scale in draw tool

The `u_scale` should be given a default value of `1.0f` so that newly drawn
strokes with the drawing already having `u_scale` attributes will have
correct texture mapping size instead of a default of `0.0f`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129060
This commit is contained in:
YimingWu
2024-10-15 16:39:17 +02:00
committed by Falk David
parent 5f84f934a8
commit 1e2e90e2d4

View File

@@ -545,13 +545,17 @@ struct PaintOperationExecutor {
"cyclic", bke::AttrDomain::Curve);
bke::SpanAttributeWriter<float> softness = attributes.lookup_or_add_for_write_span<float>(
"softness", bke::AttrDomain::Curve);
bke::SpanAttributeWriter<float> u_scale = attributes.lookup_or_add_for_write_span<float>(
"u_scale", bke::AttrDomain::Curve);
cyclic.span[active_curve] = false;
materials.span[active_curve] = material_index;
softness.span[active_curve] = softness_;
curve_attributes_to_skip.add_multiple({"material_index", "cyclic", "softness"});
u_scale.span[active_curve] = 1.0f;
curve_attributes_to_skip.add_multiple({"material_index", "cyclic", "softness", "u_scale"});
cyclic.finish();
materials.finish();
softness.finish();
u_scale.finish();
if (settings_->uv_random > 0.0f || attributes.contains("rotation")) {
bke::SpanAttributeWriter<float> rotations = attributes.lookup_or_add_for_write_span<float>(