diff options
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 503670861a5..7afecb66bcc 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -115,7 +115,7 @@ void CurveComponent::ensure_owns_direct_data() /** \} */ /* -------------------------------------------------------------------- */ -/** \name Attribute Access +/** \name Attribute Access Helper Functions * \{ */ int CurveComponent::attribute_domain_size(const AttributeDomain domain) const @@ -150,12 +150,19 @@ static const CurveEval *get_curve_from_component_for_read(const GeometryComponen return curve_component.get_for_read(); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Builtin Spline Attributes + * + * Attributes with a value for every spline, stored contiguously or in every spline separately. + * \{ */ + namespace blender::bke { class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { using AsReadAttribute = GVArrayPtr (*)(const CurveEval &data); using AsWriteAttribute = GVMutableArrayPtr (*)(CurveEval &data); - using UpdateOnWrite = void (*)(Spline &spline); const AsReadAttribute as_read_attribute_; const AsWriteAttribute as_write_attribute_; @@ -182,7 +189,6 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { if (curve == nullptr) { return {}; } - return as_read_attribute_(*curve); } @@ -195,7 +201,6 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { if (curve == nullptr) { return {}; } - return as_write_attribute_(*curve); } @@ -278,6 +283,12 @@ static GVMutableArrayPtr make_cyclic_write_attribute(CurveEval &curve) curve.splines.as_mutable_span()); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Attribute Provider Declaration + * \{ */ + /** * In this function all the attribute providers for a curve component are created. Most data * in this function is statically allocated, because it does not change over time. |