Fix: Curve trim node test failure

Caused by 60c59d7d61. The position wasn't copied into the correct
place on each spline. Somehow I didn't catch that in the tests I ran.
This commit is contained in:
Hans Goudey 2021-12-22 18:38:30 -06:00
parent 8f89196be2
commit 1931387799
1 changed files with 10 additions and 5 deletions

View File

@ -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()) {