Fix #108273: Mirror modifier resets copied custom normals

The "no custom" normal used to be stored inside the custom normal space
struct, now it's stored separately. Before the normal was modified, but
not the one in the normal space struct. Fixed by storing the original
before modification in a temporary variable.
This commit is contained in:
Hans Goudey
2023-05-30 16:28:29 -04:00
parent ac4b76318a
commit 1551d7f033

View File

@@ -430,12 +430,14 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
if (j > src_poly.start()) {
mirrorj += result_polys[mirror_i].size() - (j - src_poly.start());
}
const blender::float3 orig_normal = loop_normals[mirrorj];
copy_v3_v3(loop_normals[mirrorj], loop_normals[j]);
mul_m4_v3(mtx_nor, loop_normals[mirrorj]);
const int space_index = lnors_spacearr.corner_space_indices[mirrorj];
blender::bke::mesh::lnor_space_custom_normal_to_data(&lnors_spacearr.spaces[space_index],
loop_normals[mirrorj],
orig_normal,
loop_normals[mirrorj],
clnors[mirrorj]);
}