diff --git a/scripts/startup/bl_ui/properties_paint_common.py b/scripts/startup/bl_ui/properties_paint_common.py index f71cf3ede62..88b8ee5635e 100644 --- a/scripts/startup/bl_ui/properties_paint_common.py +++ b/scripts/startup/bl_ui/properties_paint_common.py @@ -1444,8 +1444,6 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact= row.prop(gp_settings, "caps_type", text="", expand=True) else: row.prop(gp_settings, "caps_type", text="Caps Type") - # TODO: Remove this when caps work. - row.enabled = False elif grease_pencil_tool == 'ERASE': layout.prop(gp_settings, "eraser_mode", expand=True) if gp_settings.eraser_mode == "HARD": diff --git a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc index e6e2d3315c0..fb4dc73c0d6 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_paint.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_paint.cc @@ -238,13 +238,21 @@ struct PaintOperationExecutor { "hardness", bke::AttrDomain::Curve, bke::AttributeInitVArray(VArray::ForSingle(1.0f, curves.curves_num()))); + bke::SpanAttributeWriter start_caps = attributes.lookup_or_add_for_write_span( + "start_cap", bke::AttrDomain::Curve); + bke::SpanAttributeWriter end_caps = attributes.lookup_or_add_for_write_span( + "end_cap", bke::AttrDomain::Curve); cyclic.span.last() = false; materials.span.last() = material_index; hardnesses.span.last() = hardness_; + start_caps.span.last() = settings_->caps_type; + end_caps.span.last() = settings_->caps_type; cyclic.finish(); materials.finish(); hardnesses.finish(); + start_caps.finish(); + end_caps.finish(); curves.curve_types_for_write().last() = CURVE_TYPE_POLY; curves.update_curve_types(); @@ -254,10 +262,11 @@ struct PaintOperationExecutor { bke::AttrDomain::Point, {"position", "radius", "opacity", "vertex_color"}, curves.points_range().take_back(1)); - bke::fill_attribute_range_default(attributes, - bke::AttrDomain::Curve, - {"curve_type", "material_index", "cyclic", "hardness"}, - curves.curves_range().take_back(1)); + bke::fill_attribute_range_default( + attributes, + bke::AttrDomain::Curve, + {"curve_type", "material_index", "cyclic", "hardness", "start_cap", "end_cap"}, + curves.curves_range().take_back(1)); drawing_->tag_topology_changed(); }