Fix: GPv3: Draw tool not writing hardness attribute
This commit is contained in:
@@ -146,6 +146,7 @@ struct PaintOperationExecutor {
|
||||
|
||||
BrushGpencilSettings *settings_;
|
||||
float4 vertex_color_;
|
||||
float hardness_;
|
||||
|
||||
bke::greasepencil::Drawing *drawing_;
|
||||
|
||||
@@ -170,6 +171,8 @@ struct PaintOperationExecutor {
|
||||
settings_->vertex_factor) :
|
||||
float4(0.0f);
|
||||
srgb_to_linearrgb_v4(vertex_color_, vertex_color_);
|
||||
/* TODO: UI setting. */
|
||||
hardness_ = 1.0f;
|
||||
|
||||
// const bool use_vertex_color_fill = use_vertex_color && ELEM(
|
||||
// brush->gpencil_settings->vertex_mode, GPPAINT_MODE_STROKE, GPPAINT_MODE_BOTH);
|
||||
@@ -233,11 +236,17 @@ struct PaintOperationExecutor {
|
||||
"material_index", bke::AttrDomain::Curve);
|
||||
bke::SpanAttributeWriter<bool> cyclic = attributes.lookup_or_add_for_write_span<bool>(
|
||||
"cyclic", bke::AttrDomain::Curve);
|
||||
bke::SpanAttributeWriter<float> hardnesses = attributes.lookup_or_add_for_write_span<float>(
|
||||
"hardness",
|
||||
bke::AttrDomain::Curve,
|
||||
bke::AttributeInitVArray(VArray<float>::ForSingle(1.0f, curves.curves_num())));
|
||||
cyclic.span.last() = false;
|
||||
materials.span.last() = material_index;
|
||||
hardnesses.span.last() = hardness_;
|
||||
|
||||
cyclic.finish();
|
||||
materials.finish();
|
||||
hardnesses.finish();
|
||||
|
||||
curves.curve_types_for_write().last() = CURVE_TYPE_POLY;
|
||||
curves.update_curve_types();
|
||||
|
||||
Reference in New Issue
Block a user