diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-13 18:48:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-13 18:48:37 +0300 |
commit | 903b786f69af342c5eda5c58ab25d827369c09cb (patch) | |
tree | 7f407a929a068c92df1860d0083897b426e04318 /source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc | |
parent | 56ca4fe5bb3c3d8cd92a1c99fc83856aaefdd0c2 (diff) | |
parent | 2373a2196e21b35998961fff2f53c5fa98036cd8 (diff) |
Merge branch 'master' into refactor-vertex-group-namesrefactor-vertex-group-names
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc index fc65d1754e9..ad0c453c2af 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc @@ -87,6 +87,23 @@ static SplinePtr resample_spline(const Spline &input_spline, const int count) input_spline.tilts().first(), input_spline.radii().first()); output_spline->attributes.reallocate(1); + input_spline.attributes.foreach_attribute( + [&](StringRefNull name, const AttributeMetaData &meta_data) { + std::optional<GSpan> src = input_spline.attributes.get_for_read(name); + BLI_assert(src); + if (!output_spline->attributes.create(name, meta_data.data_type)) { + BLI_assert_unreachable(); + return false; + } + std::optional<GMutableSpan> dst = output_spline->attributes.get_for_write(name); + if (!dst) { + BLI_assert_unreachable(); + return false; + } + src->type().copy_assign(src->data(), dst->data()); + return true; + }, + ATTR_DOMAIN_POINT); return output_spline; } |