Blender  V3.3
Functions
BKE_mesh_legacy_convert.h File Reference
#include "BLI_utildefines.h"

Go to the source code of this file.

Functions

void BKE_mesh_tessface_calc (struct Mesh *mesh)
 
void BKE_mesh_tessface_ensure (struct Mesh *mesh)
 
void BKE_mesh_add_mface_layers (struct CustomData *fdata, struct CustomData *ldata, int total)
 
int BKE_mesh_mface_index_validate (struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr)
 
void BKE_mesh_convert_mfaces_to_mpolys (struct Mesh *mesh)
 
void BKE_mesh_do_versions_convert_mfaces_to_mpolys (struct Mesh *mesh)
 
BLI_INLINE int BKE_mesh_origindex_mface_mpoly (const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i)
 

Function Documentation

◆ BKE_mesh_add_mface_layers()

void BKE_mesh_add_mface_layers ( struct CustomData fdata,
struct CustomData ldata,
int  total 
)

◆ BKE_mesh_convert_mfaces_to_mpolys()

void BKE_mesh_convert_mfaces_to_mpolys ( struct Mesh mesh)

◆ BKE_mesh_do_versions_convert_mfaces_to_mpolys()

void BKE_mesh_do_versions_convert_mfaces_to_mpolys ( struct Mesh mesh)

The same as BKE_mesh_convert_mfaces_to_mpolys but oriented to be used in do_versions from readfile.c the difference is how active/render/clone/stencil indices are handled here.

normally they're being set from pdata which totally makes sense for meshes which are already converted to BMesh structures, but when loading older files indices shall be updated in other way around, so newly added pdata and ldata would have this indices set based on fdata layer.

this is normally only needed when reading older files, in all other cases BKE_mesh_convert_mfaces_to_mpolys shall be always used.

Definition at line 337 of file mesh_legacy_convert.cc.

References BKE_mesh_update_customdata_pointers(), convert_mfaces_to_mpolys(), CustomData_bmesh_do_versions_update_active_layers(), Mesh::fdata, Mesh::id, Mesh::ldata, Mesh::medge, mesh, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, and Mesh::totpoly.

Referenced by do_versions_after_linking_280().

◆ BKE_mesh_mface_index_validate()

int BKE_mesh_mface_index_validate ( struct MFace mface,
struct CustomData mfdata,
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.

Definition at line 470 of file mesh_legacy_convert.cc.

References CustomData_swap_corners(), SWAP, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.

Referenced by cutEdges(), explodeMesh(), and mesh_tessface_calc().

◆ BKE_mesh_origindex_mface_mpoly()

BLI_INLINE int BKE_mesh_origindex_mface_mpoly ( const int *  index_mf_to_mpoly,
const int *  index_mp_to_orig,
const int  i 
)

Definition at line 63 of file BKE_mesh_legacy_convert.h.

Referenced by psys_particle_dm_face_lookup().

◆ BKE_mesh_tessface_calc()

void BKE_mesh_tessface_calc ( struct Mesh mesh)

Recreate MFace Tessellation.

Note
This doesn't use multi-threading like BKE_mesh_recalc_looptri since it's not used in many places and MFace should be phased out.

Definition at line 781 of file mesh_legacy_convert.cc.

References BKE_mesh_update_customdata_pointers(), Mesh::fdata, Mesh::ldata, mesh, mesh_tessface_calc(), Mesh::mvert, Mesh::pdata, Mesh::totface, Mesh::totloop, and Mesh::totpoly.

Referenced by BKE_mesh_tessface_ensure(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().

◆ BKE_mesh_tessface_ensure()

void BKE_mesh_tessface_ensure ( struct Mesh mesh)