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:
@@ -348,8 +348,7 @@ int BKE_mesh_tessface_calc_ex(struct CustomData *fdata,
|
|||||||
struct MVert *mvert,
|
struct MVert *mvert,
|
||||||
int totface,
|
int totface,
|
||||||
int totloop,
|
int totloop,
|
||||||
int totpoly,
|
int totpoly);
|
||||||
bool do_face_nor_copy);
|
|
||||||
void BKE_mesh_tessface_calc(struct Mesh *mesh);
|
void BKE_mesh_tessface_calc(struct Mesh *mesh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -160,8 +160,7 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
|
|||||||
MVert *mvert,
|
MVert *mvert,
|
||||||
int totface,
|
int totface,
|
||||||
int totloop,
|
int totloop,
|
||||||
int totpoly,
|
int totpoly)
|
||||||
const bool do_face_nor_copy)
|
|
||||||
{
|
{
|
||||||
#define USE_TESSFACE_SPEEDUP
|
#define USE_TESSFACE_SPEEDUP
|
||||||
#define USE_TESSFACE_QUADS
|
#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_add_layer(fdata, CD_ORIGINDEX, CD_ASSIGN, mface_to_poly_map, totface);
|
||||||
CustomData_from_bmeshpoly(fdata, ldata, 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:
|
/* NOTE: quad detection issue - fourth vertidx vs fourth loopidx:
|
||||||
* Polygons take care of their loops ordering, hence not of their vertices ordering.
|
* 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.
|
* 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)
|
void BKE_mesh_tessface_calc(Mesh *mesh)
|
||||||
{
|
{
|
||||||
mesh->totface = BKE_mesh_tessface_calc_ex(
|
mesh->totface = BKE_mesh_tessface_calc_ex(&mesh->fdata,
|
||||||
&mesh->fdata,
|
&mesh->ldata,
|
||||||
&mesh->ldata,
|
&mesh->pdata,
|
||||||
&mesh->pdata,
|
mesh->mvert,
|
||||||
mesh->mvert,
|
mesh->totface,
|
||||||
mesh->totface,
|
mesh->totloop,
|
||||||
mesh->totloop,
|
mesh->totpoly);
|
||||||
mesh->totpoly,
|
|
||||||
/* Calculate normals right after, don't copy from polys here. */
|
|
||||||
false);
|
|
||||||
|
|
||||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user