diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-29 02:47:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-29 02:47:38 +0300 |
commit | d29a079cb69db31d5b857f39d727614e39a2e47c (patch) | |
tree | f46018a4f89ac939833375d67f37e8233d02f674 /source/blender | |
parent | fd1078e1055e6932fc539a1fae4c7d433b1839d9 (diff) | |
parent | 03b57d39731a3902ac99d2e8e23aa309ac21c131 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc index 19efd4b7508..c0c1244f031 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc @@ -282,18 +282,20 @@ static void copy_uniform_sample_point_attributes(const Span<SplinePtr> splines, } if (!data.tangents.is_empty()) { - spline.sample_with_index_factors<float3>( - spline.evaluated_tangents(), uniform_samples, data.tangents.slice(offset, size)); - for (float3 &tangent : data.tangents) { - tangent = math::normalize(tangent); + Span<float3> src_tangents = spline.evaluated_tangents(); + MutableSpan<float3> sampled_tangents = data.tangents.slice(offset, size); + spline.sample_with_index_factors<float3>(src_tangents, uniform_samples, sampled_tangents); + for (float3 &vector : sampled_tangents) { + vector = math::normalize(vector); } } if (!data.normals.is_empty()) { - spline.sample_with_index_factors<float3>( - spline.evaluated_normals(), uniform_samples, data.normals.slice(offset, size)); - for (float3 &normals : data.normals) { - normals = math::normalize(normals); + Span<float3> src_normals = spline.evaluated_normals(); + MutableSpan<float3> sampled_normals = data.normals.slice(offset, size); + spline.sample_with_index_factors<float3>(src_normals, uniform_samples, sampled_normals); + for (float3 &vector : sampled_normals) { + vector = math::normalize(vector); } } } |