Cleanup: Make mesh normal calculation function const

Since this outputs to a separate array and not a custom data layer,
it actually doesn't change the mesh (after 580833165c anyway).
This commit is contained in:
Hans Goudey
2023-08-04 13:05:08 -04:00
parent 81096abe2a
commit f97a51350d
3 changed files with 3 additions and 3 deletions

View File

@@ -469,7 +469,7 @@ void BKE_mesh_calc_normals_split(struct Mesh *mesh);
* That data, among other things, contains 'smooth fan' info, useful e.g.
* to split geometry along sharp edges.
*/
void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh,
void BKE_mesh_calc_normals_split_ex(const struct Mesh *mesh,
struct MLoopNorSpaceArray *r_lnors_spacearr,
float (*r_corner_normals)[3]);

View File

@@ -1778,7 +1778,7 @@ static float (*ensure_corner_normal_layer(Mesh &mesh))[3]
return r_loop_normals;
}
void BKE_mesh_calc_normals_split_ex(Mesh *mesh,
void BKE_mesh_calc_normals_split_ex(const Mesh *mesh,
MLoopNorSpaceArray *r_lnors_spacearr,
float (*r_corner_normals)[3])
{

View File

@@ -336,7 +336,7 @@ static void compute_normal_outputs(const Mesh &mesh,
{
Array<float3> corner_normals(mesh.totloop);
BKE_mesh_calc_normals_split_ex(
const_cast<Mesh *>(&mesh), nullptr, reinterpret_cast<float(*)[3]>(corner_normals.data()));
&mesh, nullptr, reinterpret_cast<float(*)[3]>(corner_normals.data()));
const Span<MLoopTri> looptris = mesh.looptris();
threading::parallel_for(bary_coords.index_range(), 512, [&](const IndexRange range) {