Cleanup: Remove unused argument to mesh tessellation

This removes manual handling of normals that was hard-coded
to false in the one place the function was called. This change
will help to make a fix to T95839 simpler.
This commit is contained in:
Hans Goudey 2022-02-18 13:39:16 -06:00
parent 969c4a45ce
commit ef0e21f0ae
Notes: blender-bot 2023-02-14 11:07:28 +01:00
Referenced by commit 3cebfadb27, OCIO: Fix gpu include file
2 changed files with 9 additions and 26 deletions

View File

@ -348,8 +348,7 @@ int BKE_mesh_tessface_calc_ex(struct CustomData *fdata,
struct MVert *mvert,
int totface,
int totloop,
int totpoly,
bool do_face_nor_copy);
int totpoly);
void BKE_mesh_tessface_calc(struct Mesh *mesh);
/**

View File

@ -160,8 +160,7 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
MVert *mvert,
int totface,
int totloop,
int totpoly,
const bool do_face_nor_copy)
int totpoly)
{
#define USE_TESSFACE_SPEEDUP
#define USE_TESSFACE_QUADS
@ -363,18 +362,6 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
CustomData_add_layer(fdata, CD_ORIGINDEX, CD_ASSIGN, mface_to_poly_map, totface);
CustomData_from_bmeshpoly(fdata, ldata, totface);
if (do_face_nor_copy) {
/* If polys have a normals layer, copying that to faces can help
* avoid the need to recalculate normals later. */
if (CustomData_has_layer(pdata, CD_NORMAL)) {
float(*pnors)[3] = CustomData_get_layer(pdata, CD_NORMAL);
float(*fnors)[3] = CustomData_add_layer(fdata, CD_NORMAL, CD_CALLOC, NULL, totface);
for (mface_index = 0; mface_index < totface; mface_index++) {
copy_v3_v3(fnors[mface_index], pnors[mface_to_poly_map[mface_index]]);
}
}
}
/* NOTE: quad detection issue - fourth vertidx vs fourth loopidx:
* Polygons take care of their loops ordering, hence not of their vertices ordering.
* Currently, our tfaces' fourth vertex index might be 0 even for a quad.
@ -411,16 +398,13 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
void BKE_mesh_tessface_calc(Mesh *mesh)
{
mesh->totface = BKE_mesh_tessface_calc_ex(
&mesh->fdata,
&mesh->ldata,
&mesh->pdata,
mesh->mvert,
mesh->totface,
mesh->totloop,
mesh->totpoly,
/* Calculate normals right after, don't copy from polys here. */
false);
mesh->totface = BKE_mesh_tessface_calc_ex(&mesh->fdata,
&mesh->ldata,
&mesh->pdata,
mesh->mvert,
mesh->totface,
mesh->totloop,
mesh->totpoly);
BKE_mesh_update_customdata_pointers(mesh, true);
}