Merge branch 'blender-v4.2-release'

This commit is contained in:
Jesse Yurkovich 2024-07-07 12:28:30 -07:00
commit 74c282f532

@ -25,6 +25,7 @@
#include "BLI_map.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_span.hh"
#include "BLI_task.hh"
#include "DNA_customdata_types.h"
#include "DNA_material_types.h"
@ -269,6 +270,14 @@ bool USDMeshReader::topology_changed(const Mesh *existing_mesh, const double mot
normal_interpolation_ = mesh_prim_.GetNormalsInterpolation();
}
/* Blender expects mesh normals to actually be normalized. */
MutableSpan<pxr::GfVec3f> usd_data(normals_.data(), normals_.size());
threading::parallel_for(usd_data.index_range(), 4096, [&](const IndexRange range) {
for (const int normal_i : range) {
usd_data[normal_i].Normalize();
}
});
return positions_.size() != existing_mesh->verts_num ||
face_counts_.size() != existing_mesh->faces_num ||
face_indices_.size() != existing_mesh->corners_num;