Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-02-18 22:39:16 +0300
committerHans Goudey <h.goudey@me.com>2022-02-18 22:39:16 +0300
commitef0e21f0ae71d9ec4ba3cdf6f6a16c9575459ced (patch)
treeef158131124dc1ada68b34da08cac88de66674aa /source/blender/blenkernel/intern
parent969c4a45ce09100edc961fd0dc6f37d4689373c7 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/mesh_tessellate.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/source/blender/blenkernel/intern/mesh_tessellate.c b/source/blender/blenkernel/intern/mesh_tessellate.c
index 241aefc418c..4c4e008f615 100644
--- a/source/blender/blenkernel/intern/mesh_tessellate.c
+++ b/source/blender/blenkernel/intern/mesh_tessellate.c
@@ -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);
}