Cleanup: rename test_index_face -> BKE_mesh_mface_index_validate

This commit is contained in:
2021-06-18 15:13:52 +10:00
parent 2e8d7fa7ee
commit c4958bc540
4 changed files with 13 additions and 8 deletions

View File

@@ -135,7 +135,10 @@ bool BKE_mesh_clear_facemap_customdata(struct Mesh *me);
float (*BKE_mesh_orco_verts_get(struct Object *ob))[3];
void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
int BKE_mesh_mface_index_validate(struct MFace *mface,
struct CustomData *mfdata,
int mfindex,
int nr);
struct Mesh *BKE_mesh_from_object(struct Object *ob);
void BKE_mesh_assign_object(struct Main *bmain, struct Object *ob, struct Mesh *me);
void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me);

View File

@@ -1214,9 +1214,11 @@ void BKE_mesh_orco_verts_transform(Mesh *me, float (*orco)[3], int totvert, int
}
}
/* rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0.
* this is necessary to make the if (mface->v4) check for quads work */
int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
/**
* Rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0.
* this is necessary to make the if #MFace.v4 check for quads work.
*/
int BKE_mesh_mface_index_validate(MFace *mface, CustomData *fdata, int mfindex, int nr)
{
/* first test if the face is legal */
if ((mface->v3 || nr == 4) && mface->v3 == mface->v4) {

View File

@@ -394,13 +394,13 @@ int BKE_mesh_tessface_calc_ex(CustomData *fdata,
/* NOTE: quad detection issue - fourth vertidx vs fourth loopidx:
* ...However, most TFace code uses 'MFace->v4 == 0' test to check whether it is a tri or quad.
* test_index_face() will check this and rotate the tessellated face if needed.
* BKE_mesh_mface_index_validate() will check this and rotate the tessellated face if needed.
*/
#ifdef USE_TESSFACE_QUADS
mf = mface;
for (mface_index = 0; mface_index < totface; mface_index++, mf++) {
if (mf->edcode == TESSFACE_IS_QUAD) {
test_index_face(mf, fdata, mface_index, 4);
BKE_mesh_mface_index_validate(mf, fdata, mface_index, 4);
mf->edcode = 0;
}
}

View File

@@ -891,7 +891,7 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh)
for (i = 0; i < curdupface; i++) {
mf = &split_m->mface[i];
test_index_face(mf, &split_m->fdata, i, ((mf->flag & ME_FACE_SEL) ? 4 : 3));
BKE_mesh_mface_index_validate(mf, &split_m->fdata, i, ((mf->flag & ME_FACE_SEL) ? 4 : 3));
}
BLI_edgehash_free(edgehash, NULL);
@@ -1106,7 +1106,7 @@ static Mesh *explodeMesh(ExplodeModifierData *emd,
mtf->uv[0][1] = mtf->uv[1][1] = mtf->uv[2][1] = mtf->uv[3][1] = 0.5f;
}
test_index_face(mf, &explode->fdata, u, (orig_v4 ? 4 : 3));
BKE_mesh_mface_index_validate(mf, &explode->fdata, u, (orig_v4 ? 4 : 3));
u++;
}