Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2021-07-18 14:14:23 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2021-07-18 14:14:23 +0300
commitca50a1f762703d477ee84cf494dec601fd540299 (patch)
treefbd86a77e77015d7cc6becc1255a63e436a45b2a /source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc
parentd35969a74ff7a71fc0ca233ae65a2f1c47eb9a25 (diff)
parente82c5c660778b3805f50f3f2901923692c17db2a (diff)
Merge branch 'master' into geometry-nodes-unnamed-attributesgeometry-nodes-unnamed-attributes
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.cc17
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;
}