diff options
author | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:22:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:22:09 +0300 |
commit | 627f3571271e5f1a416314fb73f8e3c613271db3 (patch) | |
tree | 913e453295db56a9099262e6e3b30b8fdb90335c /source/blender/blenkernel/intern/geometry_set_instances.cc | |
parent | 192a3f1a05d00f1f10f32861c098b66f78cff3e4 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_set_instances.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_set_instances.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index 97892075eca..81984321b70 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -563,6 +563,17 @@ static void join_curve_splines(Span<GeometryInstanceGroup> set_groups, CurveComp } } + for (SplinePtr &spline : new_curve->splines()) { + /* Spline instances should have no custom attributes, since they always come + * from original objects which currenty do not support custom attributes. + * + * This is only true as long as a GeometrySet cannot be instanced directly. */ + BLI_assert(spline->attributes.data.totlayer == 0); + UNUSED_VARS_NDEBUG(spline); + } + + new_curve->attributes.reallocate(new_curve->splines().size()); + result.replace(new_curve); } |