Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions
BKE_mesh_mapping.h File Reference

Go to the source code of this file.

Classes

struct  UvVertMap
 
struct  UvMapVert
 
struct  UvElement
 
struct  UvElementMap
 
struct  MeshElemMap
 
struct  MeshIslandStore
 

Macros

#define STD_UV_CONNECT_LIMIT   0.0001f
 
#define INVALID_ISLAND   ((unsigned int)-1)
 
#define BKE_MESH_TESSTRI_VINDEX_ORDER(_tri, _v)
 

Typedefs

typedef struct UvVertMap UvVertMap
 
typedef struct UvMapVert UvMapVert
 
typedef struct UvElement UvElement
 
typedef struct UvElementMap UvElementMap
 
typedef struct MeshElemMap MeshElemMap
 
typedef struct MeshIslandStore MeshIslandStore
 
typedef bool(* MeshRemapIslandsCalc) (struct MVert *verts, const int totvert, struct MEdge *edges, const int totedge, struct MPoly *polys, const int totpoly, struct MLoop *loops, const int totloop, struct MeshIslandStore *r_island_store)
 

Enumerations

enum  {
  MISLAND_TYPE_NONE = 0 , MISLAND_TYPE_VERT = 1 , MISLAND_TYPE_EDGE = 2 , MISLAND_TYPE_POLY = 3 ,
  MISLAND_TYPE_LOOP = 4
}
 

Functions

UvVertMapBKE_mesh_uv_vert_map_create (const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, const float limit[2], const bool selected, const bool use_winding)
 
UvMapVertBKE_mesh_uv_vert_map_get_vert (UvVertMap *vmap, unsigned int v)
 
void BKE_mesh_uv_vert_map_free (UvVertMap *vmap)
 
void BKE_mesh_vert_poly_map_create (MeshElemMap **r_map, int **r_mem, const struct MPoly *mpoly, const struct MLoop *mloop, int totvert, int totpoly, int totloop)
 
void BKE_mesh_vert_loop_map_create (MeshElemMap **r_map, int **r_mem, const struct MPoly *mpoly, const struct MLoop *mloop, int totvert, int totpoly, int totloop)
 
void BKE_mesh_vert_looptri_map_create (MeshElemMap **r_map, int **r_mem, const struct MVert *mvert, const int totvert, const struct MLoopTri *mlooptri, const int totlooptri, const struct MLoop *mloop, const int totloop)
 
void BKE_mesh_vert_edge_map_create (MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totvert, int totedge)
 
void BKE_mesh_vert_edge_vert_map_create (MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totvert, int totedge)
 
void BKE_mesh_edge_loop_map_create (MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, const int totedge, const struct MPoly *mpoly, const int totpoly, const struct MLoop *mloop, const int totloop)
 
void BKE_mesh_edge_poly_map_create (MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, const int totedge, const struct MPoly *mpoly, const int totpoly, const struct MLoop *mloop, const int totloop)
 
void BKE_mesh_origindex_map_create (MeshElemMap **r_map, int **r_mem, const int totsource, const int *final_origindex, const int totfinal)
 
void BKE_mesh_origindex_map_create_looptri (MeshElemMap **r_map, int **r_mem, const struct MPoly *mpoly, const int mpoly_num, const struct MLoopTri *looptri, const int looptri_num)
 
void BKE_mesh_loop_islands_init (MeshIslandStore *island_store, const short item_type, const int items_num, const short island_type, const short innercut_type)
 
void BKE_mesh_loop_islands_clear (MeshIslandStore *island_store)
 
void BKE_mesh_loop_islands_free (MeshIslandStore *island_store)
 
void BKE_mesh_loop_islands_add (MeshIslandStore *island_store, const int item_num, const int *items_indices, const int num_island_items, int *island_item_indices, const int num_innercut_items, int *innercut_item_indices)
 
bool BKE_mesh_calc_islands_loop_poly_edgeseam (struct MVert *verts, const int totvert, struct MEdge *edges, const int totedge, struct MPoly *polys, const int totpoly, struct MLoop *loops, const int totloop, MeshIslandStore *r_island_store)
 
bool BKE_mesh_calc_islands_loop_poly_uvmap (struct MVert *verts, const int totvert, struct MEdge *edges, const int totedge, struct MPoly *polys, const int totpoly, struct MLoop *loops, const int totloop, const struct MLoopUV *luvs, MeshIslandStore *r_island_store)
 
int * BKE_mesh_calc_smoothgroups (const struct MEdge *medge, const int totedge, const struct MPoly *mpoly, const int totpoly, const struct MLoop *mloop, const int totloop, int *r_totgroup, const bool use_bitflags)
 

Macro Definition Documentation

◆ BKE_MESH_TESSTRI_VINDEX_ORDER

#define BKE_MESH_TESSTRI_VINDEX_ORDER (   _tri,
  _v 
)
Value:
_tri, unsigned int *, int *, int[3], const unsigned int *, const int *, const int[3]), \
CHECK_TYPE_ANY(_v, unsigned int, const unsigned int, int, const int)), \
(((_tri)[0] == _v) ? 0 : ((_tri)[1] == _v) ? 1 : ((_tri)[2] == _v) ? 2 : -1))
#define CHECK_TYPE_ANY(...)

Definition at line 248 of file BKE_mesh_mapping.h.

◆ INVALID_ISLAND

#define INVALID_ISLAND   ((unsigned int)-1)

Definition at line 88 of file BKE_mesh_mapping.h.

◆ STD_UV_CONNECT_LIMIT

#define STD_UV_CONNECT_LIMIT   0.0001f

Definition at line 39 of file BKE_mesh_mapping.h.

Typedef Documentation

◆ MeshElemMap

typedef struct MeshElemMap MeshElemMap

◆ MeshIslandStore

◆ MeshRemapIslandsCalc

typedef bool(* MeshRemapIslandsCalc) (struct MVert *verts, const int totvert, struct MEdge *edges, const int totedge, struct MPoly *polys, const int totpoly, struct MLoop *loops, const int totloop, struct MeshIslandStore *r_island_store)

Definition at line 204 of file BKE_mesh_mapping.h.

◆ UvElement

typedef struct UvElement UvElement

◆ UvElementMap

typedef struct UvElementMap UvElementMap

◆ UvMapVert

typedef struct UvMapVert UvMapVert

◆ UvVertMap

typedef struct UvVertMap UvVertMap

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MISLAND_TYPE_NONE 
MISLAND_TYPE_VERT 
MISLAND_TYPE_EDGE 
MISLAND_TYPE_POLY 
MISLAND_TYPE_LOOP 

Definition at line 165 of file BKE_mesh_mapping.h.

Function Documentation

◆ BKE_mesh_calc_islands_loop_poly_edgeseam()

bool BKE_mesh_calc_islands_loop_poly_edgeseam ( MVert verts,
const int  totvert,
MEdge edges,
const int  totedge,
MPoly polys,
const int  totpoly,
MLoop loops,
const int  totloop,
MeshIslandStore r_island_store 
)

Calculate 'generic' UV islands, i.e. based only on actual geometry data (edge seams), not some UV layers coordinates.

Definition at line 1209 of file mesh_mapping.c.

References mesh_calc_islands_loop_poly_uv(), NULL, and verts.

Referenced by data_transfer_get_loop_islands_generator().

◆ BKE_mesh_calc_islands_loop_poly_uvmap()

bool BKE_mesh_calc_islands_loop_poly_uvmap ( struct MVert verts,
const int  totvert,
struct MEdge edges,
const int  totedge,
struct MPoly polys,
const int  totpoly,
struct MLoop loops,
const int  totloop,
const struct MLoopUV luvs,
MeshIslandStore r_island_store 
)

◆ BKE_mesh_calc_smoothgroups()

int* BKE_mesh_calc_smoothgroups ( const struct MEdge medge,
const int  totedge,
const struct MPoly mpoly,
const int  totpoly,
const struct MLoop mloop,
const int  totloop,
int *  r_totgroup,
const bool  use_bitflags 
)

◆ BKE_mesh_edge_loop_map_create()

void BKE_mesh_edge_loop_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MEdge medge,
const int  totedge,
const struct MPoly mpoly,
const int  totpoly,
const struct MLoop mloop,
const int  totloop 
)

◆ BKE_mesh_edge_poly_map_create()

void BKE_mesh_edge_poly_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MEdge medge,
const int  totedge,
const struct MPoly mpoly,
const int  totpoly,
const struct MLoop mloop,
const int  totloop 
)

◆ BKE_mesh_loop_islands_add()

void BKE_mesh_loop_islands_add ( MeshIslandStore island_store,
const int  item_num,
const int *  items_indices,
const int  num_island_items,
int *  island_item_indices,
const int  num_innercut_items,
int *  innercut_item_indices 
)

◆ BKE_mesh_loop_islands_clear()

void BKE_mesh_loop_islands_clear ( MeshIslandStore island_store)

◆ BKE_mesh_loop_islands_free()

void BKE_mesh_loop_islands_free ( MeshIslandStore island_store)

Definition at line 946 of file mesh_mapping.c.

References BLI_memarena_free(), MeshIslandStore::mem, and NULL.

Referenced by BKE_mesh_remap_calc_loops_from_mesh().

◆ BKE_mesh_loop_islands_init()

void BKE_mesh_loop_islands_init ( MeshIslandStore island_store,
const short  item_type,
const int  items_num,
const short  island_type,
const short  innercut_type 
)

◆ BKE_mesh_origindex_map_create()

void BKE_mesh_origindex_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const int  totsource,
const int *  final_origindex,
const int  totfinal 
)

This function creates a map so the source-data (vert/edge/loop/poly) can loop over the destination data (using the destination arrays origindex).

This has the advantage that it can operate on any data-types.

Parameters
totsourceThe total number of elements the that final_origindex points to.
totfinalThe size of final_origindex
final_origindexThe size of the final array.
Note
totsource could be totpoly, totfinal could be tottessface and final_origindex its ORIGINDEX customdata. This would allow an MPoly to loop over its tessfaces.

Definition at line 546 of file mesh_mapping.c.

References BLI_assert, MeshElemMap::count, MeshElemMap::indices, indices, MEM_callocN, MEM_mallocN, and ORIGINDEX_NONE.

◆ BKE_mesh_origindex_map_create_looptri()

void BKE_mesh_origindex_map_create_looptri ( MeshElemMap **  r_map,
int **  r_mem,
const struct MPoly mpoly,
const int  mpoly_num,
const struct MLoopTri looptri,
const int  looptri_num 
)

◆ BKE_mesh_uv_vert_map_create()

UvVertMap* BKE_mesh_uv_vert_map_create ( const struct MPoly mpoly,
const struct MLoop mloop,
const struct MLoopUV mloopuv,
unsigned int  totpoly,
unsigned int  totvert,
const float  limit[2],
const bool  selected,
const bool  use_winding 
)

◆ BKE_mesh_uv_vert_map_free()

void BKE_mesh_uv_vert_map_free ( UvVertMap vmap)

◆ BKE_mesh_uv_vert_map_get_vert()

UvMapVert* BKE_mesh_uv_vert_map_get_vert ( UvVertMap vmap,
unsigned int  v 
)

Definition at line 179 of file mesh_mapping.c.

References v, and UvVertMap::vert.

Referenced by get_face_uv_map_vert(), precalc_uv_layer(), and ss_sync_from_uv().

◆ BKE_mesh_vert_edge_map_create()

void BKE_mesh_vert_edge_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MEdge medge,
int  totvert,
int  totedge 
)

◆ BKE_mesh_vert_edge_vert_map_create()

void BKE_mesh_vert_edge_vert_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MEdge medge,
int  totvert,
int  totedge 
)

◆ BKE_mesh_vert_loop_map_create()

void BKE_mesh_vert_loop_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MPoly mpoly,
const struct MLoop mloop,
int  totvert,
int  totpoly,
int  totloop 
)

◆ BKE_mesh_vert_looptri_map_create()

void BKE_mesh_vert_looptri_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MVert mvert,
const int  totvert,
const struct MLoopTri mlooptri,
const int  totlooptri,
const struct MLoop mloop,
const int  totloop 
)

◆ BKE_mesh_vert_poly_map_create()

void BKE_mesh_vert_poly_map_create ( MeshElemMap **  r_map,
int **  r_mem,
const struct MPoly mpoly,
const struct MLoop mloop,
int  totvert,
int  totpoly,
int  totloop 
)