diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-18 08:08:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-18 08:08:23 +0300 |
commit | 2e8d7fa7ee442fffafdd13a9a9c096fcc1d5baad (patch) | |
tree | 4cd9611e9326dae3b80c7643e7dd37698e258d1e /source/blender/blenkernel/intern | |
parent | 253c5d25f79f08e8801778bc7d36403c9419901d (diff) |
Cleanup: remove unused MFace custom-data utilities
Remove:
- BKE_mesh_loops_to_mface_corners
- BKE_mesh_tangent_loops_to_tessdata
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index 56f820848cb..2260ffc668a 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -2785,126 +2785,6 @@ void BKE_mesh_calc_volume(const MVert *mverts, /** \name NGon Tessellation (NGon/Tessface Conversion) * \{ */ -/** - * Convert a triangle or quadrangle of loop/poly data to tessface data - */ -void BKE_mesh_loops_to_mface_corners( - CustomData *fdata, - CustomData *ldata, - CustomData *UNUSED(pdata), - uint lindex[4], - int findex, - const int UNUSED(polyindex), - const int mf_len, /* 3 or 4 */ - - /* cache values to avoid lookups every time */ - const int numUV, /* CustomData_number_of_layers(ldata, CD_MLOOPUV) */ - const int numCol, /* CustomData_number_of_layers(ldata, CD_MLOOPCOL) */ - const bool hasPCol, /* CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL) */ - const bool hasOrigSpace, /* CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP) */ - const bool hasLNor /* CustomData_has_layer(ldata, CD_NORMAL) */ -) -{ - MTFace *texface; - MCol *mcol; - MLoopCol *mloopcol; - MLoopUV *mloopuv; - int i, j; - - for (i = 0; i < numUV; i++) { - texface = CustomData_get_n(fdata, CD_MTFACE, findex, i); - - for (j = 0; j < mf_len; j++) { - mloopuv = CustomData_get_n(ldata, CD_MLOOPUV, (int)lindex[j], i); - copy_v2_v2(texface->uv[j], mloopuv->uv); - } - } - - for (i = 0; i < numCol; i++) { - mcol = CustomData_get_n(fdata, CD_MCOL, findex, i); - - for (j = 0; j < mf_len; j++) { - mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, (int)lindex[j], i); - MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]); - } - } - - if (hasPCol) { - mcol = CustomData_get(fdata, findex, CD_PREVIEW_MCOL); - - for (j = 0; j < mf_len; j++) { - mloopcol = CustomData_get(ldata, (int)lindex[j], CD_PREVIEW_MLOOPCOL); - MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]); - } - } - - if (hasOrigSpace) { - OrigSpaceFace *of = CustomData_get(fdata, findex, CD_ORIGSPACE); - OrigSpaceLoop *lof; - - for (j = 0; j < mf_len; j++) { - lof = CustomData_get(ldata, (int)lindex[j], CD_ORIGSPACE_MLOOP); - copy_v2_v2(of->uv[j], lof->uv); - } - } - - if (hasLNor) { - short(*tlnors)[3] = CustomData_get(fdata, findex, CD_TESSLOOPNORMAL); - - for (j = 0; j < mf_len; j++) { - normal_float_to_short_v3(tlnors[j], CustomData_get(ldata, (int)lindex[j], CD_NORMAL)); - } - } -} - -void BKE_mesh_tangent_loops_to_tessdata(CustomData *fdata, - CustomData *ldata, - MFace *mface, - const int *polyindices, - uint (*loopindices)[4], - const int num_faces, - const char *layer_name) -{ - /* Note: performances are sub-optimal when we get a NULL mface, - * we could be ~25% quicker with dedicated code... - * Issue is, unless having two different functions with nearly the same code, - * there's not much ways to solve this. Better imho to live with it for now. :/ --mont29 - */ - - float(*ftangents)[4] = NULL; - float(*ltangents)[4] = NULL; - - int findex, j; - const int *pidx; - uint(*lidx)[4]; - - if (layer_name) { - ltangents = CustomData_get_layer_named(ldata, CD_TANGENT, layer_name); - } - else { - ltangents = CustomData_get_layer(ldata, CD_TANGENT); - } - - if (ltangents) { - /* need to do for all uv maps at some point */ - if (layer_name) { - ftangents = CustomData_get_layer_named(fdata, CD_TANGENT, layer_name); - } - else { - ftangents = CustomData_get_layer(fdata, CD_TANGENT); - } - if (ftangents) { - for (findex = 0, pidx = polyindices, lidx = loopindices; findex < num_faces; - pidx++, lidx++, findex++) { - int nverts = (mface ? mface[findex].v4 : (*lidx)[3]) ? 4 : 3; - for (j = nverts; j--;) { - copy_v4_v4(ftangents[findex * 4 + j], ltangents[(*lidx)[j]]); - } - } - } - } -} - static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata, |