From 627f3571271e5f1a416314fb73f8e3c613271db3 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 19 May 2021 13:22:09 -0400 Subject: Geometry Nodes: Support for dynamic attributes on curve splines With this patch you will be able to add and remove attributes from curve data inside of geometry nodes. The following is currently implemented: * Adding attributes with any data type to splines or spline points. * Support for working with multiple splines at the same time. * Interaction with the three builtin point attributes. * Resampling attributes in the resample node. The following is not implemented in this patch: * Joining attributes when joining splines with the join geometry node. * Domain interpolation between spline and point domains. * More efficient ways to call attribute operations once per spline. Differential Revision: https://developer.blender.org/D11251 --- source/blender/blenkernel/intern/spline_bezier.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/intern/spline_bezier.cc') diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index 58a8f46730a..0fd3efce033 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -55,6 +55,9 @@ void BezierSpline::set_resolution(const int value) this->mark_cache_invalid(); } +/** + * \warning Call #reallocate on the spline's attributes after adding all points. + */ void BezierSpline::add_point(const float3 position, const HandleType handle_type_start, const float3 handle_position_start, @@ -83,6 +86,7 @@ void BezierSpline::resize(const int size) radii_.resize(size); tilts_.resize(size); this->mark_cache_invalid(); + attributes.reallocate(size); } MutableSpan BezierSpline::positions() -- cgit v1.2.3