Fix #115526: missing normals on first chunk of array modifier #115612

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:115526 into main 2023-11-30 15:50:02 +01:00
1 changed files with 3 additions and 1 deletions

View File

@ -599,7 +599,9 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd,
Vector<float3> dst_vert_normals;
if (!use_recalc_normals) {
src_vert_normals = mesh->vert_normals();
dst_vert_normals.reinitialize(result->totvert);
dst_vert_normals.as_mutable_span()

Better to call dst_vert_normals.as_mutable_span().take_front(src_vert_normals.size()).copy_from(src_vert_normals);
Maybe broken up into two lines or so though.

This way the vector doesn't need to be allocated twice with different sizes.

Better to call `dst_vert_normals.as_mutable_span().take_front(src_vert_normals.size()).copy_from(src_vert_normals);` Maybe broken up into two lines or so though. This way the vector doesn't need to be allocated twice with different sizes.
.take_front(src_vert_normals.size())
.copy_from(src_vert_normals);
}
for (c = 1; c < count; c++) {