Fix #149438: Set Uniform Opacity removes Opacity from other stokes

In case there is no "fill_opacity" attribute already, this was added,
but not initialized with 1.0 for unselected strokes.
This is now fixed (similar to 089a435376).

Also added a `finish()` call that was missed in 9759a9df5e it seems.

Pull Request: https://projects.blender.org/blender/blender/pulls/149444
This commit is contained in:
Philipp Oeser 2025-11-06 15:16:29 +01:00 • committed by Philipp Oeser
parent a445f6be96
commit 01059b9ac0

View file

@ -1072,11 +1072,14 @@ static wmOperatorStatus grease_pencil_set_uniform_opacity_exec(bContext *C, wmOp
bke::curves::fill_points<float>(points_by_curve, strokes, opacity_stroke, opacities);
if (SpanAttributeWriter<float> fill_opacities = attributes.lookup_or_add_for_write_span<float>(
"fill_opacity", AttrDomain::Curve))
"fill_opacity",
AttrDomain::Curve,
bke::AttributeInitVArray(VArray<float>::from_single(1.0f, curves.curves_num()))))
{
strokes.foreach_index(GrainSize(2048), [&](const int64_t curve) {
fill_opacities.span[curve] = opacity_fill;
});
fill_opacities.finish();
}
changed = true;