diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-23 03:38:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-23 03:38:30 +0300 |
commit | 1931387799919e5a6bb4ebfec8922a6bf6ab3ca5 (patch) | |
tree | f197b35e4051cee7b12be4c06def9e5aa789fc39 | |
parent | 8f89196be252cd541a0669c0aed02f4ad457e39d (diff) |
Fix: Curve trim node test failure
Caused by 60c59d7d611dfd726. The position wasn't copied into the correct
place on each spline. Somehow I didn't catch that in the tests I ran.
-rw-r--r-- | source/blender/geometry/intern/mesh_to_curve_convert.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/geometry/intern/mesh_to_curve_convert.cc b/source/blender/geometry/intern/mesh_to_curve_convert.cc index 398ce609d55..965c09984fa 100644 --- a/source/blender/geometry/intern/mesh_to_curve_convert.cc +++ b/source/blender/geometry/intern/mesh_to_curve_convert.cc @@ -93,13 +93,18 @@ static std::unique_ptr<CurveEval> create_curve_from_vert_indices( } } + VArray<float3> mesh_positions = mesh_component.attribute_get_for_read( + "position", ATTR_DOMAIN_POINT, float3(0)); + threading::parallel_for(splines.index_range(), 128, [&](IndexRange range) { + for (const int i : range) { + copy_attribute_to_points(mesh_positions, vert_indices[i], splines[i]->positions()); + } + }); + for (const bke::AttributeIDRef &attribute_id : source_attribute_ids) { if (mesh_component.attribute_is_builtin(attribute_id)) { - /* Don't copy attributes that are built-in on meshes but not on curves, - * except for the position attribute. */ - if (!(attribute_id == "position")) { - continue; - } + /* Don't copy attributes that are built-in on meshes but not on curves. */ + continue; } if (!attribute_id.should_be_kept()) { |