Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions | Variables
BKE_mesh.h File Reference
#include "BKE_mesh_types.h"
#include "BLI_utildefines.h"

Go to the source code of this file.

Classes

struct  MLoopNorSpace
 
struct  MLoopNorSpaceArray
 

Macros

#define BKE_MESH_OMP_LIMIT   10000
 

Typedefs

typedef struct MLoopNorSpace MLoopNorSpace
 
typedef struct MLoopNorSpaceArray MLoopNorSpaceArray
 

Enumerations

enum  { MLNOR_SPACE_IS_SINGLE = 1 << 0 }
 
enum  { MLNOR_SPACEARR_LOOP_INDEX = 0 , MLNOR_SPACEARR_BMLOOP_PTR = 1 }
 
enum  { MESH_MERGE_VERTS_DUMP_IF_MAPPED , MESH_MERGE_VERTS_DUMP_IF_EQUAL }
 

Functions

struct BMeshBKE_mesh_to_bmesh_ex (const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params)
 
struct BMeshBKE_mesh_to_bmesh (struct Mesh *me, struct Object *ob, const bool add_key_index, const struct BMeshCreateParams *params)
 
struct MeshBKE_mesh_from_bmesh_nomain (struct BMesh *bm, const struct BMeshToMeshParams *params, const struct Mesh *me_settings)
 
struct MeshBKE_mesh_from_bmesh_for_eval_nomain (struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings)
 
int poly_find_loop_from_vert (const struct MPoly *poly, const struct MLoop *loopstart, uint vert)
 
int poly_get_adj_loops_from_vert (const struct MPoly *poly, const struct MLoop *mloop, unsigned int vert, unsigned int r_adj[2])
 
int BKE_mesh_edge_other_vert (const struct MEdge *e, int v)
 
void BKE_mesh_looptri_get_real_edges (const struct Mesh *mesh, const struct MLoopTri *looptri, int r_edges[3])
 
void BKE_mesh_free_data (struct Mesh *me)
 
void BKE_mesh_clear_geometry (struct Mesh *me)
 
struct MeshBKE_mesh_add (struct Main *bmain, const char *name)
 
void BKE_mesh_copy_settings (struct Mesh *me_dst, const struct Mesh *me_src)
 
void BKE_mesh_update_customdata_pointers (struct Mesh *me, const bool do_ensure_tess_cd)
 
void BKE_mesh_ensure_skin_customdata (struct Mesh *me)
 
struct MeshBKE_mesh_new_nomain (int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
 
struct MeshBKE_mesh_new_nomain_from_template (const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
 
struct MeshBKE_mesh_new_nomain_from_template_ex (const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, struct CustomData_MeshMasks mask)
 
void BKE_mesh_eval_delete (struct Mesh *mesh_eval)
 
struct MeshBKE_mesh_copy_for_eval (struct Mesh *source, bool reference)
 
struct MeshBKE_mesh_new_nomain_from_curve (struct Object *ob)
 
struct MeshBKE_mesh_new_nomain_from_curve_displist (struct Object *ob, struct ListBase *dispbase)
 
bool BKE_mesh_ensure_facemap_customdata (struct Mesh *me)
 
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)
 
struct MeshBKE_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)
 
int BKE_mesh_nurbs_to_mdata (struct Object *ob, struct MVert **r_allvert, int *r_totvert, struct MEdge **r_alledge, int *r_totedge, struct MLoop **r_allloop, struct MPoly **r_allpoly, int *r_totloop, int *r_totpoly)
 
int BKE_mesh_nurbs_displist_to_mdata (struct Object *ob, const struct ListBase *dispbase, struct MVert **r_allvert, int *r_totvert, struct MEdge **r_alledge, int *r_totedge, struct MLoop **r_allloop, struct MPoly **r_allpoly, struct MLoopUV **r_alluv, int *r_totloop, int *r_totpoly)
 
void BKE_mesh_from_nurbs_displist (struct Main *bmain, struct Object *ob, struct ListBase *dispbase, const char *obdata_name, bool temporary)
 
void BKE_mesh_from_nurbs (struct Main *bmain, struct Object *ob)
 
void BKE_mesh_to_curve_nurblist (const struct Mesh *me, struct ListBase *nurblist, const int edge_users_test)
 
void BKE_mesh_to_curve (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
 
void BKE_pointcloud_from_mesh (struct Mesh *me, struct PointCloud *pointcloud)
 
void BKE_mesh_to_pointcloud (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
 
void BKE_mesh_from_pointcloud (const struct PointCloud *pointcloud, struct Mesh *me)
 
void BKE_pointcloud_to_mesh (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
 
void BKE_mesh_material_index_remove (struct Mesh *me, short index)
 
bool BKE_mesh_material_index_used (struct Mesh *me, short index)
 
void BKE_mesh_material_index_clear (struct Mesh *me)
 
void BKE_mesh_material_remap (struct Mesh *me, const unsigned int *remap, unsigned int remap_len)
 
void BKE_mesh_smooth_flag_set (struct Mesh *me, const bool use_smooth)
 
void BKE_mesh_edges_set_draw_render (struct Mesh *me)
 
const char * BKE_mesh_cmp (struct Mesh *me1, struct Mesh *me2, float thresh)
 
struct BoundBoxBKE_mesh_boundbox_get (struct Object *ob)
 
void BKE_mesh_texspace_calc (struct Mesh *me)
 
void BKE_mesh_texspace_ensure (struct Mesh *me)
 
void BKE_mesh_texspace_get (struct Mesh *me, float r_loc[3], float r_size[3])
 
void BKE_mesh_texspace_get_reference (struct Mesh *me, short **r_texflag, float **r_loc, float **r_size)
 
void BKE_mesh_texspace_copy_from_object (struct Mesh *me, struct Object *ob)
 
void BKE_mesh_split_faces (struct Mesh *mesh, bool free_loop_normals)
 
struct MeshBKE_mesh_new_from_object (struct Depsgraph *depsgraph, struct Object *object, const bool preserve_all_data_layers, const bool preserve_origindex)
 
struct MeshBKE_mesh_new_from_object_to_bmain (struct Main *bmain, struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers)
 
struct MeshBKE_mesh_create_derived_for_modifier (struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob_eval, struct ModifierData *md_eval, const bool build_shapekey_layers)
 
void BKE_mesh_nomain_to_mesh (struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob, const struct CustomData_MeshMasks *mask, bool take_ownership)
 
void BKE_mesh_nomain_to_meshkey (struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb)
 
bool BKE_mesh_minmax (const struct Mesh *me, float r_min[3], float r_max[3])
 
void BKE_mesh_transform (struct Mesh *me, const float mat[4][4], bool do_keys)
 
void BKE_mesh_translate (struct Mesh *me, const float offset[3], const bool do_keys)
 
void BKE_mesh_tessface_calc (struct Mesh *mesh)
 
void BKE_mesh_tessface_ensure (struct Mesh *mesh)
 
void BKE_mesh_tessface_clear (struct Mesh *mesh)
 
void BKE_mesh_do_versions_cd_flag_init (struct Mesh *mesh)
 
void BKE_mesh_mselect_clear (struct Mesh *me)
 
void BKE_mesh_mselect_validate (struct Mesh *me)
 
int BKE_mesh_mselect_find (struct Mesh *me, int index, int type)
 
int BKE_mesh_mselect_active_get (struct Mesh *me, int type)
 
void BKE_mesh_mselect_active_set (struct Mesh *me, int index, int type)
 
void BKE_mesh_count_selected_items (const struct Mesh *mesh, int r_count[3])
 
float(* BKE_mesh_vert_coords_alloc (const struct Mesh *mesh, int *r_vert_len))[3]
 
void BKE_mesh_vert_coords_get (const struct Mesh *mesh, float(*vert_coords)[3])
 
void BKE_mesh_vert_coords_apply_with_mat4 (struct Mesh *mesh, const float(*vert_coords)[3], const float mat[4][4])
 
void BKE_mesh_vert_coords_apply (struct Mesh *mesh, const float(*vert_coords)[3])
 
void BKE_mesh_vert_normals_apply (struct Mesh *mesh, const short(*vert_normals)[3])
 
void BKE_mesh_calc_normals_mapping_simple (struct Mesh *me)
 
void BKE_mesh_calc_normals_mapping (struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const struct MFace *mfaces, int numFaces, const int *origIndexFace, float(*r_faceNors)[3])
 
void BKE_mesh_calc_normals_mapping_ex (struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const struct MFace *mfaces, int numFaces, const int *origIndexFace, float(*r_faceNors)[3], const bool only_face_normals)
 
void BKE_mesh_calc_normals_poly (struct MVert *mverts, float(*r_vertnors)[3], int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const bool only_face_normals)
 
void BKE_mesh_calc_normals (struct Mesh *me)
 
void BKE_mesh_ensure_normals (struct Mesh *me)
 
void BKE_mesh_ensure_normals_for_display (struct Mesh *mesh)
 
void BKE_mesh_calc_normals_looptri (struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num, float(*r_tri_nors)[3])
 
void BKE_mesh_loop_manifold_fan_around_vert_next (const struct MLoop *mloops, const struct MPoly *mpolys, const int *loop_to_poly, const int *e2lfan_curr, const uint mv_pivot_index, const struct MLoop **r_mlfan_curr, int *r_mlfan_curr_index, int *r_mlfan_vert_index, int *r_mpfan_curr_index)
 
void BKE_edges_sharp_from_angle_set (const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, const float split_angle)
 
void BKE_lnor_spacearr_init (MLoopNorSpaceArray *lnors_spacearr, const int numLoops, const char data_type)
 
void BKE_lnor_spacearr_clear (MLoopNorSpaceArray *lnors_spacearr)
 
void BKE_lnor_spacearr_free (MLoopNorSpaceArray *lnors_spacearr)
 
MLoopNorSpaceBKE_lnor_space_create (MLoopNorSpaceArray *lnors_spacearr)
 
void BKE_lnor_space_define (MLoopNorSpace *lnor_space, const float lnor[3], float vec_ref[3], float vec_other[3], struct BLI_Stack *edge_vectors)
 
void BKE_lnor_space_add_loop (MLoopNorSpaceArray *lnors_spacearr, MLoopNorSpace *lnor_space, const int ml_index, void *bm_loop, const bool is_single)
 
void BKE_lnor_space_custom_data_to_normal (MLoopNorSpace *lnor_space, const short clnor_data[2], float r_custom_lnor[3])
 
void BKE_lnor_space_custom_normal_to_data (MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2])
 
void BKE_mesh_normals_loop_split (const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, float(*r_loopnors)[3], const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, const bool use_split_normals, const float split_angle, MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], int *r_loop_to_poly)
 
void BKE_mesh_normals_loop_custom_set (const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, float(*r_custom_loopnors)[3], const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, short(*r_clnors_data)[2])
 
void BKE_mesh_normals_loop_custom_from_vertices_set (const struct MVert *mverts, float(*r_custom_vertnors)[3], const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, short(*r_clnors_data)[2])
 
void BKE_mesh_normals_loop_to_vertex (const int numVerts, const struct MLoop *mloops, const int numLoops, const float(*clnors)[3], float(*r_vert_clnors)[3])
 
bool BKE_mesh_has_custom_loop_normals (struct Mesh *me)
 
void BKE_mesh_calc_normals_split (struct Mesh *mesh)
 
void BKE_mesh_calc_normals_split_ex (struct Mesh *mesh, struct MLoopNorSpaceArray *r_lnors_spacearr)
 
void BKE_mesh_set_custom_normals (struct Mesh *mesh, float(*r_custom_loopnors)[3])
 
void BKE_mesh_set_custom_normals_from_vertices (struct Mesh *mesh, float(*r_custom_vertnors)[3])
 
void BKE_mesh_calc_poly_normal (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_no[3])
 
void BKE_mesh_calc_poly_normal_coords (const struct MPoly *mpoly, const struct MLoop *loopstart, const float(*vertex_coords)[3], float r_no[3])
 
void BKE_mesh_calc_poly_center (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_cent[3])
 
float BKE_mesh_calc_poly_area (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray)
 
float BKE_mesh_calc_area (const struct Mesh *me)
 
float BKE_mesh_calc_poly_uv_area (const struct MPoly *mpoly, const struct MLoopUV *uv_array)
 
void BKE_mesh_calc_poly_angles (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float angles[])
 
void BKE_mesh_poly_edgehash_insert (struct EdgeHash *ehash, const struct MPoly *mp, const struct MLoop *mloop)
 
void BKE_mesh_poly_edgebitmap_insert (unsigned int *edge_bitmap, const struct MPoly *mp, const struct MLoop *mloop)
 
bool BKE_mesh_center_median (const struct Mesh *me, float r_cent[3])
 
bool BKE_mesh_center_median_from_polys (const struct Mesh *me, float r_cent[3])
 
bool BKE_mesh_center_bounds (const struct Mesh *me, float r_cent[3])
 
bool BKE_mesh_center_of_surface (const struct Mesh *me, float r_cent[3])
 
bool BKE_mesh_center_of_volume (const struct Mesh *me, float r_cent[3])
 
void BKE_mesh_calc_volume (const struct MVert *mverts, const int mverts_num, const struct MLoopTri *mlooptri, const int looptri_num, const struct MLoop *mloop, float *r_volume, float r_center[3])
 
void BKE_mesh_loops_to_mface_corners (struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, unsigned int lindex[4], int findex, const int polyindex, const int mf_len, const int numUV, const int numCol, const bool hasPCol, const bool hasOrigSpace, const bool hasLNor)
 
void BKE_mesh_loops_to_tessdata (struct CustomData *fdata, struct CustomData *ldata, struct MFace *mface, const int *polyindices, unsigned int(*loopindices)[4], const int num_faces)
 
void BKE_mesh_tangent_loops_to_tessdata (struct CustomData *fdata, struct CustomData *ldata, struct MFace *mface, const int *polyindices, unsigned int(*loopindices)[4], const int num_faces, const char *layer_name)
 
int BKE_mesh_tessface_calc_ex (struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, struct MVert *mvert, int totface, int totloop, int totpoly, const bool do_face_nor_copy)
 
void BKE_mesh_recalc_looptri (const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri)
 
void BKE_mesh_convert_mfaces_to_mpolys (struct Mesh *mesh)
 
void BKE_mesh_do_versions_convert_mfaces_to_mpolys (struct Mesh *mesh)
 
void BKE_mesh_convert_mfaces_to_mpolys_ex (struct ID *id, struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, int totedge_i, int totface_i, int totloop_i, int totpoly_i, struct MEdge *medge, struct MFace *mface, int *r_totloop, int *r_totpoly, struct MLoop **r_mloop, struct MPoly **r_mpoly)
 
void BKE_mesh_mdisp_flip (struct MDisps *md, const bool use_loop_mdisp_flip)
 
void BKE_mesh_polygon_flip_ex (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, float(*lnors)[3], struct MDisps *mdisp, const bool use_loop_mdisp_flip)
 
void BKE_mesh_polygon_flip (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata)
 
void BKE_mesh_polygons_flip (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, int totpoly)
 
struct MeshBKE_mesh_merge_verts (struct Mesh *mesh, const int *vtargetmap, const int tot_vtargetmap, const int merge_mode)
 
void BKE_mesh_flush_hidden_from_verts_ex (const struct MVert *mvert, const struct MLoop *mloop, struct MEdge *medge, const int totedge, struct MPoly *mpoly, const int totpoly)
 
void BKE_mesh_flush_hidden_from_verts (struct Mesh *me)
 
void BKE_mesh_flush_hidden_from_polys_ex (struct MVert *mvert, const struct MLoop *mloop, struct MEdge *medge, const int totedge, const struct MPoly *mpoly, const int totpoly)
 
void BKE_mesh_flush_hidden_from_polys (struct Mesh *me)
 
void BKE_mesh_flush_select_from_polys_ex (struct MVert *mvert, const int totvert, const struct MLoop *mloop, struct MEdge *medge, const int totedge, const struct MPoly *mpoly, const int totpoly)
 
void BKE_mesh_flush_select_from_polys (struct Mesh *me)
 
void BKE_mesh_flush_select_from_verts_ex (const struct MVert *mvert, const int totvert, const struct MLoop *mloop, struct MEdge *medge, const int totedge, struct MPoly *mpoly, const int totpoly)
 
void BKE_mesh_flush_select_from_verts (struct Mesh *me)
 
void BKE_mesh_calc_relative_deform (const struct MPoly *mpoly, const int totpoly, const struct MLoop *mloop, const int totvert, const float(*vert_cos_src)[3], const float(*vert_cos_dst)[3], const float(*vert_cos_org)[3], float(*vert_cos_new)[3])
 
bool BKE_mesh_validate (struct Mesh *me, const bool do_verbose, const bool cddata_check_mask)
 
bool BKE_mesh_is_valid (struct Mesh *me)
 
bool BKE_mesh_validate_material_indices (struct Mesh *me)
 
bool BKE_mesh_validate_arrays (struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, struct MFace *mfaces, unsigned int totface, struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, const bool do_verbose, const bool do_fixes, bool *r_change)
 
bool BKE_mesh_validate_all_customdata (struct CustomData *vdata, const uint totvert, struct CustomData *edata, const uint totedge, struct CustomData *ldata, const uint totloop, struct CustomData *pdata, const uint totpoly, const bool check_meshmask, const bool do_verbose, const bool do_fixes, bool *r_change)
 
void BKE_mesh_strip_loose_faces (struct Mesh *me)
 
void BKE_mesh_strip_loose_polysloops (struct Mesh *me)
 
void BKE_mesh_strip_loose_edges (struct Mesh *me)
 
void BKE_mesh_calc_edges_legacy (struct Mesh *me, const bool use_old)
 
void BKE_mesh_calc_edges_loose (struct Mesh *mesh)
 
void BKE_mesh_calc_edges (struct Mesh *mesh, bool keep_existing_edges, const bool select_new_edges)
 
void BKE_mesh_calc_edges_tessface (struct Mesh *mesh)
 
void BKE_mesh_wrapper_deferred_finalize (struct Mesh *me_eval, const CustomData_MeshMasks *cd_mask_finalize)
 
void BKE_mesh_eval_geometry (struct Depsgraph *depsgraph, struct Mesh *mesh)
 
void BKE_mesh_batch_cache_dirty_tag (struct Mesh *me, eMeshBatchDirtyMode mode)
 
void BKE_mesh_batch_cache_free (struct Mesh *me)
 
BLI_INLINE int BKE_mesh_origindex_mface_mpoly (const int *index_mf_to_mpoly, const int *index_mp_to_orig, const int i)
 

Variables

void(* BKE_mesh_batch_cache_dirty_tag_cb )(struct Mesh *me, eMeshBatchDirtyMode mode)
 
void(* BKE_mesh_batch_cache_free_cb )(struct Mesh *me)
 

Macro Definition Documentation

◆ BKE_MESH_OMP_LIMIT

#define BKE_MESH_OMP_LIMIT   10000

Definition at line 67 of file BKE_mesh.h.

Typedef Documentation

◆ MLoopNorSpace

typedef struct MLoopNorSpace MLoopNorSpace

References a contiguous loop-fan with normal offset vars.

◆ MLoopNorSpaceArray

Collection of MLoopNorSpace basic storage & pre-allocation.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

MLoopNorSpace.flags

Enumerator
MLNOR_SPACE_IS_SINGLE 

Definition at line 364 of file BKE_mesh.h.

◆ anonymous enum

anonymous enum

MLoopNorSpaceArray.data_type

Enumerator
MLNOR_SPACEARR_LOOP_INDEX 
MLNOR_SPACEARR_BMLOOP_PTR 

Definition at line 382 of file BKE_mesh.h.

◆ anonymous enum

anonymous enum
Enumerator
MESH_MERGE_VERTS_DUMP_IF_MAPPED 
MESH_MERGE_VERTS_DUMP_IF_EQUAL 

Definition at line 584 of file BKE_mesh.h.

Function Documentation

◆ BKE_edges_sharp_from_angle_set()

void BKE_edges_sharp_from_angle_set ( const struct MVert mverts,
const int  numVerts,
struct MEdge medges,
const int  numEdges,
struct MLoop mloops,
const int  numLoops,
struct MPoly mpolys,
const float(*)  polynors[3],
const int  numPolys,
const float  split_angle 
)

◆ BKE_lnor_space_add_loop()

void BKE_lnor_space_add_loop ( MLoopNorSpaceArray lnors_spacearr,
MLoopNorSpace lnor_space,
const int  ml_index,
void *  bm_loop,
const bool  is_single 
)

Add a new given loop to given lnor_space. Depending on lnor_space->data_type, we expect bm_loop to be a pointer to BMLoop struct (in case of BMLOOP_PTR), or NULL (in case of LOOP_INDEX), loop index is then stored in pointer. If is_single is set, the BMLoop or loop index is directly stored in lnor_space->loops pointer (since there is only one loop in this fan), else it is added to the linked list of loops in the fan.

Definition at line 652 of file mesh_evaluate.c.

References BLI_assert, BLI_linklist_prepend_nlink(), MLoopNorSpaceArray::data_type, MLoopNorSpace::flags, MLoopNorSpace::loops, MLoopNorSpaceArray::loops_pool, MLoopNorSpaceArray::lspacearr, MLNOR_SPACE_IS_SINGLE, MLNOR_SPACEARR_BMLOOP_PTR, MLNOR_SPACEARR_LOOP_INDEX, NULL, and POINTER_FROM_INT.

Referenced by bm_mesh_loops_calc_normals(), split_loop_nor_fan_do(), and split_loop_nor_single_do().

◆ BKE_lnor_space_create()

MLoopNorSpace* BKE_lnor_space_create ( MLoopNorSpaceArray lnors_spacearr)

◆ BKE_lnor_space_custom_data_to_normal()

void BKE_lnor_space_custom_data_to_normal ( MLoopNorSpace lnor_space,
const short  clnor_data[2],
float  r_custom_lnor[3] 
)

◆ BKE_lnor_space_custom_normal_to_data()

void BKE_lnor_space_custom_normal_to_data ( MLoopNorSpace lnor_space,
const float  custom_lnor[3],
short  r_clnor_data[2] 
)

◆ BKE_lnor_space_define()

void BKE_lnor_space_define ( MLoopNorSpace lnor_space,
const float  lnor[3],
float  vec_ref[3],
float  vec_other[3],
struct BLI_Stack edge_vectors 
)

◆ BKE_lnor_spacearr_clear()

void BKE_lnor_spacearr_clear ( MLoopNorSpaceArray lnors_spacearr)

◆ BKE_lnor_spacearr_free()

void BKE_lnor_spacearr_free ( MLoopNorSpaceArray lnors_spacearr)

◆ BKE_lnor_spacearr_init()

void BKE_lnor_spacearr_init ( MLoopNorSpaceArray lnors_spacearr,
const int  numLoops,
const char  data_type 
)

◆ BKE_mesh_add()

struct Mesh* BKE_mesh_add ( struct Main bmain,
const char *  name 
)

◆ BKE_mesh_assign_object()

void BKE_mesh_assign_object ( struct Main bmain,
struct Object ob,
struct Mesh me 
)

◆ BKE_mesh_batch_cache_dirty_tag()

void BKE_mesh_batch_cache_dirty_tag ( struct Mesh me,
eMeshBatchDirtyMode  mode 
)

◆ BKE_mesh_batch_cache_free()

void BKE_mesh_batch_cache_free ( struct Mesh me)

◆ BKE_mesh_boundbox_get()

struct BoundBox* BKE_mesh_boundbox_get ( struct Object ob)

◆ BKE_mesh_calc_area()

float BKE_mesh_calc_area ( const struct Mesh me)

Referenced by quadriflow_check().

◆ BKE_mesh_calc_edges()

void BKE_mesh_calc_edges ( Mesh mesh,
bool  keep_existing_edges,
const bool  select_new_edges 
)

◆ BKE_mesh_calc_edges_legacy()

void BKE_mesh_calc_edges_legacy ( Mesh me,
const bool  use_old 
)

If the mesh is from a very old blender version, convert mface->edcode to edge drawflags

Definition at line 1499 of file mesh_validate.c.

References BKE_mesh_strip_loose_faces(), CD_ASSIGN, CD_MEDGE, CustomData_add_layer(), Mesh::medge, mesh_calc_edges_mdata(), Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.

Referenced by blo_do_versions_pre250().

◆ BKE_mesh_calc_edges_loose()

void BKE_mesh_calc_edges_loose ( struct Mesh mesh)

◆ BKE_mesh_calc_edges_tessface()

void BKE_mesh_calc_edges_tessface ( Mesh mesh)

◆ BKE_mesh_calc_normals()

void BKE_mesh_calc_normals ( struct Mesh me)

◆ BKE_mesh_calc_normals_looptri()

void BKE_mesh_calc_normals_looptri ( struct MVert mverts,
int  numVerts,
const struct MLoop mloop,
const struct MLoopTri looptri,
int  looptri_num,
float(*)  r_tri_nors[3] 
)

◆ BKE_mesh_calc_normals_mapping()

void BKE_mesh_calc_normals_mapping ( struct MVert mverts,
int  numVerts,
const struct MLoop mloop,
const struct MPoly mpolys,
int  numLoops,
int  numPolys,
float(*)  r_polyNors[3],
const struct MFace mfaces,
int  numFaces,
const int *  origIndexFace,
float(*)  r_faceNors[3] 
)

◆ BKE_mesh_calc_normals_mapping_ex()

void BKE_mesh_calc_normals_mapping_ex ( struct MVert mverts,
int  numVerts,
const struct MLoop mloop,
const struct MPoly mpolys,
int  numLoops,
int  numPolys,
float(*)  r_polyNors[3],
const struct MFace mfaces,
int  numFaces,
const int *  origIndexFace,
float(*)  r_faceNors[3],
const bool  only_face_normals 
)

◆ BKE_mesh_calc_normals_mapping_simple()

void BKE_mesh_calc_normals_mapping_simple ( struct Mesh me)

◆ BKE_mesh_calc_normals_poly()

void BKE_mesh_calc_normals_poly ( struct MVert mverts,
float(*)  r_vertnors[3],
int  numVerts,
const struct MLoop mloop,
const struct MPoly mpolys,
int  numLoops,
int  numPolys,
float(*)  r_polyNors[3],
const bool  only_face_normals 
)

◆ BKE_mesh_calc_normals_split()

void BKE_mesh_calc_normals_split ( struct Mesh mesh)

◆ BKE_mesh_calc_normals_split_ex()

void BKE_mesh_calc_normals_split_ex ( Mesh mesh,
MLoopNorSpaceArray r_lnors_spacearr 
)

Compute 'split' (aka loop, or per face corner's) normals.

Parameters
r_lnors_spacearrAllows to get computed loop normal space array. That data, among other things, contains 'smooth fan' info, useful e.g. to split geometry along sharp edges...

Definition at line 1797 of file mesh.c.

References BKE_mesh_calc_normals_poly(), BKE_mesh_normals_loop_split(), CD_CALLOC, CD_CUSTOMLOOPNORMAL, Mesh_Runtime::cd_dirty_vert, CD_FLAG_TEMPORARY, CD_MASK_NORMAL, CD_NORMAL, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), CustomData_set_layer_flag(), Mesh::flag, float(), Mesh::ldata, M_PI, ME_AUTOSMOOTH, Mesh::medge, MEM_freeN, MEM_malloc_arrayN, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, Mesh::runtime, Mesh::smoothresh, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.

Referenced by BKE_mesh_calc_normals_split(), and BKE_mesh_split_faces().

◆ BKE_mesh_calc_poly_angles()

void BKE_mesh_calc_poly_angles ( const struct MPoly mpoly,
const struct MLoop loopstart,
const struct MVert mvarray,
float  angles[] 
)

◆ BKE_mesh_calc_poly_area()

float BKE_mesh_calc_poly_area ( const struct MPoly mpoly,
const struct MLoop loopstart,
const struct MVert mvarray 
)

◆ BKE_mesh_calc_poly_center()

void BKE_mesh_calc_poly_center ( const struct MPoly mpoly,
const struct MLoop loopstart,
const struct MVert mvarray,
float  r_cent[3] 
)

◆ BKE_mesh_calc_poly_normal()

void BKE_mesh_calc_poly_normal ( const struct MPoly mpoly,
const struct MLoop loopstart,
const struct MVert mvarray,
float  r_no[3] 
)

◆ BKE_mesh_calc_poly_normal_coords()

void BKE_mesh_calc_poly_normal_coords ( const struct MPoly mpoly,
const struct MLoop loopstart,
const float(*)  vertex_coords[3],
float  r_no[3] 
)

◆ BKE_mesh_calc_poly_uv_area()

float BKE_mesh_calc_poly_uv_area ( const struct MPoly mpoly,
const struct MLoopUV uv_array 
)

◆ BKE_mesh_calc_relative_deform()

void BKE_mesh_calc_relative_deform ( const struct MPoly mpoly,
const int  totpoly,
const struct MLoop mloop,
const int  totvert,
const float(*)  vert_cos_src[3],
const float(*)  vert_cos_dst[3],
const float(*)  vert_cos_org[3],
float(*)  vert_cos_new[3] 
)

Referenced by meshcache_do().

◆ BKE_mesh_calc_volume()

void BKE_mesh_calc_volume ( const struct MVert mverts,
const int  mverts_num,
const struct MLoopTri mlooptri,
const int  looptri_num,
const struct MLoop mloop,
float r_volume,
float  r_center[3] 
)

◆ BKE_mesh_center_bounds()

bool BKE_mesh_center_bounds ( const struct Mesh me,
float  r_cent[3] 
)

Referenced by object_origin_set_exec().

◆ BKE_mesh_center_median()

bool BKE_mesh_center_median ( const struct Mesh me,
float  r_cent[3] 
)

Referenced by object_origin_set_exec().

◆ BKE_mesh_center_median_from_polys()

bool BKE_mesh_center_median_from_polys ( const struct Mesh me,
float  r_cent[3] 
)

◆ BKE_mesh_center_of_surface()

bool BKE_mesh_center_of_surface ( const struct Mesh me,
float  r_cent[3] 
)

Referenced by object_origin_set_exec().

◆ BKE_mesh_center_of_volume()

bool BKE_mesh_center_of_volume ( const struct Mesh me,
float  r_cent[3] 
)

Referenced by object_origin_set_exec().

◆ BKE_mesh_clear_facemap_customdata()

bool BKE_mesh_clear_facemap_customdata ( struct Mesh me)

◆ BKE_mesh_clear_geometry()

void BKE_mesh_clear_geometry ( struct Mesh me)

◆ BKE_mesh_cmp()

const char* BKE_mesh_cmp ( Mesh me1,
Mesh me2,
float  thresh 
)

Used for unit testing; compares two meshes, checking only differences we care about. should be usable with leaf's testing framework I get RNA work done, will use hackish testing code for now.

Definition at line 598 of file mesh.c.

References Freestyle::c, cmpcode_to_str(), customdata_compare(), Mesh::ldata, NULL, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.

◆ BKE_mesh_convert_mfaces_to_mpolys()

void BKE_mesh_convert_mfaces_to_mpolys ( struct Mesh mesh)

◆ BKE_mesh_convert_mfaces_to_mpolys_ex()

void BKE_mesh_convert_mfaces_to_mpolys_ex ( struct ID id,
struct CustomData fdata,
struct CustomData ldata,
struct CustomData pdata,
int  totedge_i,
int  totface_i,
int  totloop_i,
int  totpoly_i,
struct MEdge medge,
struct MFace mface,
int *  r_totloop,
int *  r_totpoly,
struct MLoop **  r_mloop,
struct MPoly **  r_mpoly 
)

◆ BKE_mesh_copy_for_eval()

struct Mesh* BKE_mesh_copy_for_eval ( struct Mesh source,
bool  reference 
)

◆ BKE_mesh_copy_settings()

void BKE_mesh_copy_settings ( struct Mesh me_dst,
const struct Mesh me_src 
)

◆ BKE_mesh_count_selected_items()

void BKE_mesh_count_selected_items ( const struct Mesh mesh,
int  r_count[3] 
)

◆ BKE_mesh_create_derived_for_modifier()

struct Mesh* BKE_mesh_create_derived_for_modifier ( struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob_eval,
struct ModifierData md_eval,
const bool  build_shapekey_layers 
)

◆ BKE_mesh_do_versions_cd_flag_init()

void BKE_mesh_do_versions_cd_flag_init ( struct Mesh mesh)

◆ BKE_mesh_do_versions_convert_mfaces_to_mpolys()

void BKE_mesh_do_versions_convert_mfaces_to_mpolys ( 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 thay'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 3555 of file mesh_evaluate.c.

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

Referenced by do_versions_after_linking_280().

◆ BKE_mesh_edge_other_vert()

int BKE_mesh_edge_other_vert ( const struct MEdge e,
int  v 
)

◆ BKE_mesh_edges_set_draw_render()

void BKE_mesh_edges_set_draw_render ( struct Mesh me)

Definition at line 983 of file mesh_convert.c.

References MEdge::flag, ME_EDGEDRAW, ME_EDGERENDER, Mesh::medge, mesh, and Mesh::totedge.

Referenced by object_convert_exec().

◆ BKE_mesh_ensure_facemap_customdata()

bool BKE_mesh_ensure_facemap_customdata ( struct Mesh me)

◆ BKE_mesh_ensure_normals()

void BKE_mesh_ensure_normals ( struct Mesh me)

◆ BKE_mesh_ensure_normals_for_display()

void BKE_mesh_ensure_normals_for_display ( Mesh mesh)

◆ BKE_mesh_ensure_skin_customdata()

void BKE_mesh_ensure_skin_customdata ( struct Mesh me)

◆ BKE_mesh_eval_delete()

void BKE_mesh_eval_delete ( struct Mesh mesh_eval)

◆ BKE_mesh_eval_geometry()

void BKE_mesh_eval_geometry ( struct Depsgraph depsgraph,
struct Mesh mesh 
)

◆ BKE_mesh_flush_hidden_from_polys()

void BKE_mesh_flush_hidden_from_polys ( struct Mesh me)

◆ BKE_mesh_flush_hidden_from_polys_ex()

void BKE_mesh_flush_hidden_from_polys_ex ( struct MVert mvert,
const struct MLoop mloop,
struct MEdge medge,
const int  totedge,
const struct MPoly mpoly,
const int  totpoly 
)

◆ BKE_mesh_flush_hidden_from_verts()

void BKE_mesh_flush_hidden_from_verts ( struct Mesh me)

◆ BKE_mesh_flush_hidden_from_verts_ex()

void BKE_mesh_flush_hidden_from_verts_ex ( const struct MVert mvert,
const struct MLoop mloop,
struct MEdge medge,
const int  totedge,
struct MPoly mpoly,
const int  totpoly 
)

◆ BKE_mesh_flush_select_from_polys()

void BKE_mesh_flush_select_from_polys ( struct Mesh me)

◆ BKE_mesh_flush_select_from_polys_ex()

void BKE_mesh_flush_select_from_polys_ex ( struct MVert mvert,
const int  totvert,
const struct MLoop mloop,
struct MEdge medge,
const int  totedge,
const struct MPoly mpoly,
const int  totpoly 
)

◆ BKE_mesh_flush_select_from_verts()

void BKE_mesh_flush_select_from_verts ( struct Mesh me)

◆ BKE_mesh_flush_select_from_verts_ex()

void BKE_mesh_flush_select_from_verts_ex ( const struct MVert mvert,
const int  totvert,
const struct MLoop mloop,
struct MEdge medge,
const int  totedge,
struct MPoly mpoly,
const int  totpoly 
)

◆ BKE_mesh_free_data()

void BKE_mesh_free_data ( Mesh me)

Free (or release) any data used by this mesh (does not free the mesh itself).

Definition at line 796 of file mesh.c.

References Mesh::id, and mesh_free_data().

Referenced by BKE_mesh_eval_delete(), and undomesh_free_data().

◆ BKE_mesh_from_bmesh_for_eval_nomain()

struct Mesh* BKE_mesh_from_bmesh_for_eval_nomain ( struct BMesh bm,
const struct CustomData_MeshMasks cd_mask_extra,
const struct Mesh me_settings 
)

◆ BKE_mesh_from_bmesh_nomain()

struct Mesh* BKE_mesh_from_bmesh_nomain ( struct BMesh bm,
const struct BMeshToMeshParams params,
const struct Mesh me_settings 
)

◆ BKE_mesh_from_metaball()

void BKE_mesh_from_metaball ( struct ListBase lb,
struct Mesh me 
)

◆ BKE_mesh_from_nurbs()

void BKE_mesh_from_nurbs ( struct Main bmain,
struct Object ob 
)

Definition at line 703 of file mesh_convert.c.

References Object::data, and NULL.

◆ BKE_mesh_from_nurbs_displist()

void BKE_mesh_from_nurbs_displist ( struct Main bmain,
struct Object ob,
struct ListBase dispbase,
const char *  obdata_name,
bool  temporary 
)

◆ BKE_mesh_from_object()

struct Mesh* BKE_mesh_from_object ( struct Object ob)

◆ BKE_mesh_from_pointcloud()

void BKE_mesh_from_pointcloud ( const struct PointCloud pointcloud,
struct Mesh me 
)

◆ BKE_mesh_has_custom_loop_normals()

bool BKE_mesh_has_custom_loop_normals ( struct Mesh me)

◆ BKE_mesh_is_valid()

bool BKE_mesh_is_valid ( Mesh me)

◆ BKE_mesh_loop_manifold_fan_around_vert_next()

void BKE_mesh_loop_manifold_fan_around_vert_next ( const struct MLoop mloops,
const struct MPoly mpolys,
const int *  loop_to_poly,
const int *  e2lfan_curr,
const uint  mv_pivot_index,
const struct MLoop **  r_mlfan_curr,
int *  r_mlfan_curr_index,
int *  r_mlfan_vert_index,
int *  r_mpfan_curr_index 
)

◆ BKE_mesh_loops_to_mface_corners()

void BKE_mesh_loops_to_mface_corners ( struct CustomData fdata,
struct CustomData ldata,
struct CustomData pdata,
unsigned int  lindex[4],
int  findex,
const int  polyindex,
const int  mf_len,
const int  numUV,
const int  numCol,
const bool  hasPCol,
const bool  hasOrigSpace,
const bool  hasLNor 
)

◆ BKE_mesh_loops_to_tessdata()

void BKE_mesh_loops_to_tessdata ( CustomData fdata,
CustomData ldata,
MFace mface,
const int *  polyindices,
unsigned int(*)  loopindices[4],
const int  num_faces 
)

Convert all CD layers from loop/poly to tessface data.

Parameters
loopindicesis an array of an int[4] per tessface, mapping tessface's verts to loops indices.
Note
when mface is not NULL, mface[face_index].v4 is used to test quads, else, loopindices[face_index][3] is used.

Definition at line 2872 of file mesh_evaluate.c.

References CD_MCOL, CD_MLOOPCOL, CD_MLOOPUV, CD_MTFACE, CD_NORMAL, CD_ORIGSPACE, CD_ORIGSPACE_MLOOP, CD_PREVIEW_MCOL, CD_PREVIEW_MLOOPCOL, CD_TANGENT, CD_TESSLOOPNORMAL, copy_v2_v2(), copy_v4_v4(), CustomData_get_layer(), CustomData_get_layer_n(), CustomData_has_layer(), CustomData_number_of_layers(), float(), MESH_MLOOPCOL_TO_MCOL, normal_float_to_short_v3(), MLoopUV::uv, OrigSpaceLoop::uv, OrigSpaceFace::uv, MTFace::uv, and MFace::v4.

Referenced by BKE_mesh_tessface_calc_ex().

◆ BKE_mesh_looptri_get_real_edges()

void BKE_mesh_looptri_get_real_edges ( const struct Mesh mesh,
const struct MLoopTri looptri,
int  r_edges[3] 
)

◆ BKE_mesh_material_index_clear()

void BKE_mesh_material_index_clear ( struct Mesh me)

Definition at line 1347 of file mesh.c.

References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.

Referenced by material_data_index_clear_id().

◆ BKE_mesh_material_index_remove()

void BKE_mesh_material_index_remove ( struct Mesh me,
short  index 
)

Definition at line 1307 of file mesh.c.

References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.

Referenced by material_data_index_remove_id().

◆ BKE_mesh_material_index_used()

bool BKE_mesh_material_index_used ( struct Mesh me,
short  index 
)

Definition at line 1326 of file mesh.c.

References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.

Referenced by BKE_object_material_slot_used().

◆ BKE_mesh_material_remap()

void BKE_mesh_material_remap ( struct Mesh me,
const unsigned int *  remap,
unsigned int  remap_len 
)

◆ BKE_mesh_mdisp_flip()

void BKE_mesh_mdisp_flip ( MDisps md,
const bool  use_loop_mdisp_flip 
)

Flip a single MLoop's MDisps structure, low level function to be called from face-flipping code which re-arranged the mdisps themselves.

Definition at line 3705 of file mesh_evaluate.c.

References MDisps::disps, float(), sqrt(), SWAP, swap_v3_v3(), MDisps::totdisp, UNLIKELY, x, and y.

Referenced by BKE_mesh_polygon_flip_ex(), and bmesh_kernel_loop_reverse().

◆ BKE_mesh_merge_verts()

struct Mesh* BKE_mesh_merge_verts ( Mesh mesh,
const int *  vtargetmap,
const int  tot_vtargetmap,
const int  merge_mode 
)

Merge Verts

This frees the given mesh and returns a new mesh.

Parameters
vtargetmapThe table that maps vertices to target vertices. a value of -1 indicates a vertex is a target, and is to be kept. This array is aligned with 'mesh->totvert'
Warning
vtargetmap must not contain any chained mapping (v1 -> v2 -> v3 etc.), this is not supported and will likely generate corrupted geometry.
Parameters
tot_vtargetmapThe number of non '-1' values in vtargetmap. (not the size)
merge_modeenum with two modes.
  • MESH_MERGE_VERTS_DUMP_IF_MAPPED When called by the Mirror Modifier, In this mode it skips any faces that have all vertices merged (to avoid creating pairs of faces sharing the same set of vertices)
  • MESH_MERGE_VERTS_DUMP_IF_EQUAL When called by the Array Modifier, In this mode, faces where all vertices are merged are double-checked, to see whether all target vertices actually make up a poly already. Indeed it could be that all of a poly's vertices are merged, but merged to vertices that do not make up a single poly, in which case the original poly should not be dumped. Actually this later behavior could apply to the Mirror Modifier as well, but the additional checks are costly and not necessary in the case of mirror, because each vertex is only merged to its own mirror.
Note
BKE_mesh_tessface_calc_ex has to run on the returned DM if you want to access tessfaces.

Definition at line 239 of file mesh_merge.c.

References BKE_mesh_vert_poly_map_create(), BLI_assert, BLI_edgehash_ensure_p(), BLI_edgehash_new_ex(), BLI_edgehash_remove(), BLI_gset_flag_set(), BLI_gset_haskey(), BLI_gset_insert(), BLI_gset_new_ex(), Freestyle::c, cddm_poly_compare(), MeshElemMap::count, MLoop::e, ELEM, GHASH_FLAG_ALLOW_DUPES, PolyKey::hash_sum, PolyKey::hash_xor, MeshElemMap::indices, LIKELY, MPoly::loopstart, ME_VERT_TMP_TAG, Mesh::medge, MEM_malloc_arrayN, mesh, MESH_MERGE_VERTS_DUMP_IF_EQUAL, MESH_MERGE_VERTS_DUMP_IF_MAPPED, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, POINTER_AS_INT, POINTER_FROM_INT, poly_gset_compare_fn(), poly_gset_hash_fn(), PolyKey::poly_index, result, STACK_DECLARE, STACK_DISCARD, STACK_INIT, STACK_PUSH, STACK_PUSH_RET_PTR, STACK_SIZE, Mesh::totedge, Mesh::totloop, MPoly::totloop, PolyKey::totloops, Mesh::totpoly, Mesh::totvert, UNLIKELY, MLoop::v, v1, MEdge::v1, v2, and MEdge::v2.

Referenced by arrayModifier_doArray(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), and mesh_remove_doubles_on_axis().

◆ BKE_mesh_minmax()

bool BKE_mesh_minmax ( const struct Mesh me,
float  r_min[3],
float  r_max[3] 
)

◆ BKE_mesh_mselect_active_get()

int BKE_mesh_mselect_active_get ( Mesh me,
int  type 
)

Return The index of the active element.

Definition at line 1693 of file mesh.c.

References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.

Referenced by ED_mesh_active_dvert_get_ob().

◆ BKE_mesh_mselect_active_set()

void BKE_mesh_mselect_active_set ( struct Mesh me,
int  index,
int  type 
)

◆ BKE_mesh_mselect_clear()

void BKE_mesh_mselect_clear ( struct Mesh me)

◆ BKE_mesh_mselect_find()

int BKE_mesh_mselect_find ( Mesh me,
int  index,
int  type 
)

Return the index within me->mselect, or -1

Definition at line 1677 of file mesh.c.

References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.

Referenced by BKE_mesh_mselect_active_set().

◆ BKE_mesh_mselect_validate()

void BKE_mesh_mselect_validate ( struct Mesh me)

◆ BKE_mesh_new_from_object()

struct Mesh* BKE_mesh_new_from_object ( struct Depsgraph depsgraph,
struct Object object,
const bool  preserve_all_data_layers,
const bool  preserve_origindex 
)

◆ BKE_mesh_new_from_object_to_bmain()

struct Mesh* BKE_mesh_new_from_object_to_bmain ( struct Main bmain,
struct Depsgraph depsgraph,
struct Object object,
bool  preserve_all_data_layers 
)

◆ BKE_mesh_new_nomain()

struct Mesh* BKE_mesh_new_nomain ( int  verts_len,
int  edges_len,
int  tessface_len,
int  loops_len,
int  polys_len 
)

◆ BKE_mesh_new_nomain_from_curve()

struct Mesh* BKE_mesh_new_nomain_from_curve ( struct Object ob)

◆ BKE_mesh_new_nomain_from_curve_displist()

struct Mesh* BKE_mesh_new_nomain_from_curve_displist ( struct Object ob,
struct ListBase dispbase 
)

◆ BKE_mesh_new_nomain_from_template()

struct Mesh* BKE_mesh_new_nomain_from_template ( const struct Mesh me_src,
int  verts_len,
int  edges_len,
int  tessface_len,
int  loops_len,
int  polys_len 
)

◆ BKE_mesh_new_nomain_from_template_ex()

struct Mesh* BKE_mesh_new_nomain_from_template_ex ( const struct Mesh me_src,
int  verts_len,
int  edges_len,
int  tessface_len,
int  loops_len,
int  polys_len,
struct CustomData_MeshMasks  mask 
)

◆ BKE_mesh_nomain_to_mesh()

void BKE_mesh_nomain_to_mesh ( struct Mesh mesh_src,
struct Mesh mesh_dst,
struct Object ob,
const struct CustomData_MeshMasks mask,
bool  take_ownership 
)

◆ BKE_mesh_nomain_to_meshkey()

void BKE_mesh_nomain_to_meshkey ( struct Mesh mesh_src,
struct Mesh mesh_dst,
struct KeyBlock kb 
)

◆ BKE_mesh_normals_loop_custom_from_vertices_set()

void BKE_mesh_normals_loop_custom_from_vertices_set ( const struct MVert mverts,
float(*)  r_custom_vertnors[3],
const int  numVerts,
struct MEdge medges,
const int  numEdges,
struct MLoop mloops,
const int  numLoops,
struct MPoly mpolys,
const float(*)  polynors[3],
const int  numPolys,
short(*)  r_clnors_data[2] 
)

◆ BKE_mesh_normals_loop_custom_set()

void BKE_mesh_normals_loop_custom_set ( const struct MVert mverts,
const int  numVerts,
struct MEdge medges,
const int  numEdges,
struct MLoop mloops,
float(*)  r_custom_loopnors[3],
const int  numLoops,
struct MPoly mpolys,
const float(*)  polynors[3],
const int  numPolys,
short(*)  r_clnors_data[2] 
)

◆ BKE_mesh_normals_loop_split()

void BKE_mesh_normals_loop_split ( const struct MVert mverts,
const int  numVerts,
struct MEdge medges,
const int  numEdges,
struct MLoop mloops,
float(*)  r_loopnors[3],
const int  numLoops,
struct MPoly mpolys,
const float(*)  polynors[3],
const int  numPolys,
const bool  use_split_normals,
const float  split_angle,
MLoopNorSpaceArray r_lnors_spacearr,
short(*)  clnors_data[2],
int *  r_loop_to_poly 
)

◆ BKE_mesh_normals_loop_to_vertex()

void BKE_mesh_normals_loop_to_vertex ( const int  numVerts,
const struct MLoop mloops,
const int  numLoops,
const float(*)  clnors[3],
float(*)  r_vert_clnors[3] 
)

Referenced by displaceModifier_do().

◆ BKE_mesh_nurbs_displist_to_mdata()

int BKE_mesh_nurbs_displist_to_mdata ( struct Object ob,
const struct ListBase dispbase,
struct MVert **  r_allvert,
int *  r_totvert,
struct MEdge **  r_alledge,
int *  r_totedge,
struct MLoop **  r_allloop,
struct MPoly **  r_allpoly,
struct MLoopUV **  r_alluv,
int *  r_totloop,
int *  r_totpoly 
)

◆ BKE_mesh_nurbs_to_mdata()

int BKE_mesh_nurbs_to_mdata ( struct Object ob,
struct MVert **  r_allvert,
int *  r_totvert,
struct MEdge **  r_alledge,
int *  r_totedge,
struct MLoop **  r_allloop,
struct MPoly **  r_allpoly,
int *  r_totloop,
int *  r_totpoly 
)

◆ BKE_mesh_orco_verts_get()

float(* BKE_mesh_orco_verts_get ( struct Object ob) )[3]

◆ BKE_mesh_orco_verts_transform()

void BKE_mesh_orco_verts_transform ( struct Mesh me,
float(*)  orco[3],
int  totvert,
int  invert 
)

◆ 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 701 of file BKE_mesh.h.

Referenced by psys_particle_dm_face_lookup().

◆ BKE_mesh_poly_edgebitmap_insert()

void BKE_mesh_poly_edgebitmap_insert ( unsigned int *  edge_bitmap,
const struct MPoly mp,
const struct MLoop mloop 
)

◆ BKE_mesh_poly_edgehash_insert()

void BKE_mesh_poly_edgehash_insert ( struct EdgeHash ehash,
const struct MPoly mp,
const struct MLoop mloop 
)

Referenced by make_edges_mdata_extend().

◆ BKE_mesh_polygon_flip()

void BKE_mesh_polygon_flip ( struct MPoly mpoly,
struct MLoop mloop,
struct CustomData ldata 
)

Definition at line 3792 of file mesh_evaluate.c.

References BKE_mesh_polygon_flip_ex(), CD_MDISPS, CustomData_get_layer(), and NULL.

◆ BKE_mesh_polygon_flip_ex()

void BKE_mesh_polygon_flip_ex ( MPoly mpoly,
MLoop mloop,
CustomData ldata,
float(*)  lnors[3],
MDisps mdisp,
const bool  use_loop_mdisp_flip 
)

Flip (invert winding of) the given mpoly, i.e. reverse order of its loops (keeping the same vertex as 'start point').

Parameters
mpolythe polygon to flip.
mloopthe full loops array.
ldatathe loops custom data.

Definition at line 3749 of file mesh_evaluate.c.

References BKE_mesh_mdisp_flip(), CD_MLOOP, CustomData_get_layer(), CustomData_swap(), e, MLoop::e, MPoly::loopstart, SWAP, swap_v3_v3(), and MPoly::totloop.

Referenced by BKE_mesh_polygon_flip(), BKE_mesh_polygons_flip(), and polygons_check_flip().

◆ BKE_mesh_polygons_flip()

void BKE_mesh_polygons_flip ( MPoly mpoly,
MLoop mloop,
CustomData ldata,
int  totpoly 
)

Flip (invert winding of) all polygons (used to inverse their normals).

Note
Invalidates tessellation, caller must handle that.

Definition at line 3803 of file mesh_evaluate.c.

References BKE_mesh_polygon_flip_ex(), CD_MDISPS, CustomData_get_layer(), and NULL.

◆ BKE_mesh_recalc_looptri()

void BKE_mesh_recalc_looptri ( const struct MLoop mloop,
const struct MPoly mpoly,
const struct MVert mvert,
int  totloop,
int  totpoly,
struct MLoopTri mlooptri 
)

◆ BKE_mesh_set_custom_normals()

void BKE_mesh_set_custom_normals ( Mesh mesh,
float(*)  r_custom_loopnors[3] 
)

Higher level functions hiding most of the code needed around call to BKE_mesh_normals_loop_custom_set().

Parameters
r_custom_loopnorsis not const, since code will replace zero_v3 normals there with automatically computed vectors.

Definition at line 2100 of file mesh_evaluate.c.

References mesh, and mesh_set_custom_normals().

Referenced by modifyMesh(), blender::io::alembic::process_loop_normals(), and triangulate_mesh().

◆ BKE_mesh_set_custom_normals_from_vertices()

void BKE_mesh_set_custom_normals_from_vertices ( Mesh mesh,
float(*)  r_custom_vertnors[3] 
)

Higher level functions hiding most of the code needed around call to BKE_mesh_normals_loop_custom_from_vertices_set().

Parameters
r_custom_vertnorsis not const, since code will replace zero_v3 normals there with automatically computed vectors.

Definition at line 2112 of file mesh_evaluate.c.

References mesh, and mesh_set_custom_normals().

Referenced by blender::io::alembic::process_vertex_normals().

◆ BKE_mesh_smooth_flag_set()

void BKE_mesh_smooth_flag_set ( struct Mesh me,
const bool  use_smooth 
)

◆ BKE_mesh_split_faces()

void BKE_mesh_split_faces ( struct Mesh mesh,
bool  free_loop_normals 
)

◆ BKE_mesh_strip_loose_edges()

void BKE_mesh_strip_loose_edges ( struct Mesh me)

◆ BKE_mesh_strip_loose_faces()

void BKE_mesh_strip_loose_faces ( struct Mesh me)

◆ BKE_mesh_strip_loose_polysloops()

void BKE_mesh_strip_loose_polysloops ( Mesh me)

Works on both loops and polys!

Note
It won't try to guess which loops of an invalid poly to remove! this is the work of the caller, to mark those loops... See e.g. BKE_mesh_validate_arrays().

Definition at line 1206 of file mesh_validate.c.

References Freestyle::a, CustomData_copy_data(), CustomData_free_elem(), BMLoop::e, INVALID_LOOP_EDGE_MARKER, l, Mesh::ldata, MPoly::loopstart, MEM_freeN, MEM_mallocN, Mesh::mloop, Mesh::mpoly, Mesh::totloop, MPoly::totloop, and Mesh::totpoly.

Referenced by BKE_mesh_validate_arrays().

◆ BKE_mesh_tangent_loops_to_tessdata()

void BKE_mesh_tangent_loops_to_tessdata ( struct CustomData fdata,
struct CustomData ldata,
struct MFace mface,
const int *  polyindices,
unsigned int(*)  loopindices[4],
const int  num_faces,
const char *  layer_name 
)

◆ BKE_mesh_tessface_calc()

void BKE_mesh_tessface_calc ( struct Mesh mesh)

◆ BKE_mesh_tessface_calc_ex()

int BKE_mesh_tessface_calc_ex ( CustomData fdata,
CustomData ldata,
CustomData pdata,
MVert mvert,
int  totface,
int  totloop,
int  totpoly,
const bool  do_face_nor_copy 
)

◆ BKE_mesh_tessface_clear()

void BKE_mesh_tessface_clear ( struct Mesh mesh)

◆ BKE_mesh_tessface_ensure()

void BKE_mesh_tessface_ensure ( struct Mesh mesh)

◆ BKE_mesh_texspace_calc()

void BKE_mesh_texspace_calc ( struct Mesh me)

◆ BKE_mesh_texspace_copy_from_object()

void BKE_mesh_texspace_copy_from_object ( struct Mesh me,
struct Object ob 
)

◆ BKE_mesh_texspace_ensure()

void BKE_mesh_texspace_ensure ( struct Mesh me)

◆ BKE_mesh_texspace_get()

void BKE_mesh_texspace_get ( struct Mesh me,
float  r_loc[3],
float  r_size[3] 
)

Definition at line 1123 of file mesh.c.

References BKE_mesh_texspace_ensure(), copy_v3_v3(), Mesh::loc, and Mesh::size.

Referenced by BKE_mesh_orco_verts_transform().

◆ BKE_mesh_texspace_get_reference()

void BKE_mesh_texspace_get_reference ( struct Mesh me,
short **  r_texflag,
float **  r_loc,
float **  r_size 
)

◆ BKE_mesh_to_bmesh()

struct BMesh* BKE_mesh_to_bmesh ( struct Mesh me,
struct Object ob,
const bool  add_key_index,
const struct BMeshCreateParams params 
)

Definition at line 1019 of file mesh.c.

References BKE_mesh_to_bmesh_ex(), params, and Object::shapenr.

Referenced by EDBM_mesh_make().

◆ BKE_mesh_to_bmesh_ex()

struct BMesh* BKE_mesh_to_bmesh_ex ( const struct Mesh me,
const struct BMeshCreateParams create_params,
const struct BMeshFromMeshParams convert_params 
)

◆ BKE_mesh_to_curve()

void BKE_mesh_to_curve ( struct Main bmain,
struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob 
)

Referenced by object_convert_exec().

◆ BKE_mesh_to_curve_nurblist()

void BKE_mesh_to_curve_nurblist ( const struct Mesh me,
struct ListBase nurblist,
const int  edge_users_test 
)

◆ BKE_mesh_to_pointcloud()

void BKE_mesh_to_pointcloud ( struct Main bmain,
struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob 
)

Referenced by object_convert_exec().

◆ BKE_mesh_transform()

void BKE_mesh_transform ( struct Mesh me,
const float  mat[4][4],
bool  do_keys 
)

◆ BKE_mesh_translate()

void BKE_mesh_translate ( struct Mesh me,
const float  offset[3],
const bool  do_keys 
)

◆ BKE_mesh_update_customdata_pointers()

void BKE_mesh_update_customdata_pointers ( struct Mesh me,
const bool  do_ensure_tess_cd 
)

◆ BKE_mesh_validate()

bool BKE_mesh_validate ( Mesh me,
const bool  do_verbose,
const bool  cddata_check_mask 
)

◆ BKE_mesh_validate_all_customdata()

bool BKE_mesh_validate_all_customdata ( CustomData vdata,
const uint  totvert,
CustomData edata,
const uint  totedge,
CustomData ldata,
const uint  totloop,
CustomData pdata,
const uint  totpoly,
const bool  check_meshmask,
const bool  do_verbose,
const bool  do_fixes,
bool *  r_change 
)

◆ BKE_mesh_validate_arrays()

bool BKE_mesh_validate_arrays ( Mesh mesh,
MVert mverts,
unsigned int  totvert,
MEdge medges,
unsigned int  totedge,
MFace mfaces,
unsigned int  totface,
MLoop mloops,
unsigned int  totloop,
MPoly mpolys,
unsigned int  totpoly,
MDeformVert dverts,
const bool  do_verbose,
const bool  do_fixes,
bool *  r_changed 
)

◆ BKE_mesh_validate_material_indices()

bool BKE_mesh_validate_material_indices ( Mesh me)

Check all material indices of polygons are valid, invalid ones are set to 0.

Returns
is_valid.

Definition at line 1148 of file mesh_validate.c.

References DEG_id_tag_update(), Mesh::id, ID_RECALC_GEOMETRY, is_valid, MPoly::mat_nr, max_ii(), Mesh::mpoly, Mesh::totcol, and Mesh::totpoly.

◆ BKE_mesh_vert_coords_alloc()

float(* BKE_mesh_vert_coords_alloc ( const struct Mesh mesh,
int *  r_vert_len 
) )[3]

◆ BKE_mesh_vert_coords_apply()

void BKE_mesh_vert_coords_apply ( struct Mesh mesh,
const float(*)  vert_coords[3] 
)

◆ BKE_mesh_vert_coords_apply_with_mat4()

void BKE_mesh_vert_coords_apply_with_mat4 ( struct Mesh mesh,
const float(*)  vert_coords[3],
const float  mat[4][4] 
)

◆ BKE_mesh_vert_coords_get()

void BKE_mesh_vert_coords_get ( const struct Mesh mesh,
float(*)  vert_coords[3] 
)

◆ BKE_mesh_vert_normals_apply()

void BKE_mesh_vert_normals_apply ( struct Mesh mesh,
const short(*)  vert_normals[3] 
)

◆ BKE_mesh_wrapper_deferred_finalize()

void BKE_mesh_wrapper_deferred_finalize ( struct Mesh me_eval,
const CustomData_MeshMasks cd_mask_finalize 
)

◆ BKE_pointcloud_from_mesh()

void BKE_pointcloud_from_mesh ( struct Mesh me,
struct PointCloud pointcloud 
)

◆ BKE_pointcloud_to_mesh()

void BKE_pointcloud_to_mesh ( struct Main bmain,
struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob 
)

Referenced by object_convert_exec().

◆ poly_find_loop_from_vert()

int poly_find_loop_from_vert ( const struct MPoly poly,
const struct MLoop loopstart,
uint  vert 
)

◆ poly_get_adj_loops_from_vert()

int poly_get_adj_loops_from_vert ( const struct MPoly poly,
const struct MLoop mloop,
unsigned int  vert,
unsigned int  r_adj[2] 
)

◆ test_index_face()

int test_index_face ( struct MFace mface,
struct CustomData mfdata,
int  mfindex,
int  nr 
)

Variable Documentation

◆ BKE_mesh_batch_cache_dirty_tag_cb

void(* BKE_mesh_batch_cache_dirty_tag_cb) (struct Mesh *me, eMeshBatchDirtyMode mode) ( struct Mesh me,
eMeshBatchDirtyMode  mode 
)
extern

Definition at line 248 of file mesh_runtime.c.

Referenced by BKE_mesh_batch_cache_dirty_tag(), and DRW_engines_register().

◆ BKE_mesh_batch_cache_free_cb

void(* BKE_mesh_batch_cache_free_cb) (struct Mesh *me) ( struct Mesh me)
extern

Definition at line 249 of file mesh_runtime.c.

Referenced by BKE_mesh_batch_cache_free(), and DRW_engines_register().