Blender
V3.3
|
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 | 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, int totvert, struct MEdge *edges, int totedge, struct MPoly *polys, int totpoly, struct MLoop *loops, 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 | |
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], bool selected, bool use_winding) |
UvMapVert * | BKE_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, int totvert, const struct MLoopTri *mlooptri, int totlooptri, const struct MLoop *mloop, 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, int totedge, const struct MPoly *mpoly, int totpoly, const struct MLoop *mloop, int totloop) |
void | BKE_mesh_edge_poly_map_create (MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totedge, const struct MPoly *mpoly, int totpoly, const struct MLoop *mloop, int totloop) |
void | BKE_mesh_origindex_map_create (MeshElemMap **r_map, int **r_mem, int totsource, const int *final_origindex, int totfinal) |
void | BKE_mesh_origindex_map_create_looptri (MeshElemMap **r_map, int **r_mem, const struct MPoly *mpoly, int mpoly_num, const struct MLoopTri *looptri, int looptri_num) |
void | BKE_mesh_loop_islands_init (MeshIslandStore *island_store, short item_type, int items_num, short island_type, 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, int item_num, const int *items_indices, int num_island_items, int *island_item_indices, int num_innercut_items, int *innercut_item_indices) |
bool | BKE_mesh_calc_islands_loop_poly_edgeseam (struct MVert *verts, int totvert, struct MEdge *edges, int totedge, struct MPoly *polys, int totpoly, struct MLoop *loops, int totloop, MeshIslandStore *r_island_store) |
bool | BKE_mesh_calc_islands_loop_poly_uvmap (struct MVert *verts, int totvert, struct MEdge *edges, int totedge, struct MPoly *polys, int totpoly, struct MLoop *loops, int totloop, const struct MLoopUV *luvs, MeshIslandStore *r_island_store) |
int * | BKE_mesh_calc_smoothgroups (const struct MEdge *medge, int totedge, const struct MPoly *mpoly, int totpoly, const struct MLoop *mloop, int totloop, int *r_totgroup, bool use_bitflags) |
#define BKE_MESH_TESSTRI_VINDEX_ORDER | ( | _tri, | |
_v | |||
) |
Definition at line 304 of file BKE_mesh_mapping.h.
#define STD_UV_CONNECT_LIMIT 0.0001f |
Definition at line 23 of file BKE_mesh_mapping.h.
typedef struct MeshElemMap MeshElemMap |
typedef struct MeshIslandStore MeshIslandStore |
typedef bool(* MeshRemapIslandsCalc) (struct MVert *verts, int totvert, struct MEdge *edges, int totedge, struct MPoly *polys, int totpoly, struct MLoop *loops, int totloop, struct MeshIslandStore *r_island_store) |
Definition at line 235 of file BKE_mesh_mapping.h.
typedef struct UvElementMap UvElementMap |
anonymous enum |
Enumerator | |
---|---|
MISLAND_TYPE_NONE | |
MISLAND_TYPE_VERT | |
MISLAND_TYPE_EDGE | |
MISLAND_TYPE_POLY | |
MISLAND_TYPE_LOOP |
Definition at line 196 of file BKE_mesh_mapping.h.
bool BKE_mesh_calc_islands_loop_poly_edgeseam | ( | struct MVert * | verts, |
int | totvert, | ||
struct MEdge * | edges, | ||
int | totedge, | ||
struct MPoly * | polys, | ||
int | totpoly, | ||
struct MLoop * | loops, | ||
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 1128 of file mesh_mapping.c.
References mesh_calc_islands_loop_poly_uv(), NULL, and verts.
Referenced by data_transfer_get_loop_islands_generator().
bool BKE_mesh_calc_islands_loop_poly_uvmap | ( | struct MVert * | verts, |
int | totvert, | ||
struct MEdge * | edges, | ||
int | totedge, | ||
struct MPoly * | polys, | ||
int | totpoly, | ||
struct MLoop * | loops, | ||
int | totloop, | ||
const struct MLoopUV * | luvs, | ||
MeshIslandStore * | r_island_store | ||
) |
Calculate UV islands.
int* BKE_mesh_calc_smoothgroups | ( | const struct MEdge * | medge, |
int | totedge, | ||
const struct MPoly * | mpoly, | ||
int | totpoly, | ||
const struct MLoop * | mloop, | ||
int | totloop, | ||
int * | r_totgroup, | ||
bool | use_bitflags | ||
) |
Calculate smooth groups from sharp edges.
r_totgroup | The total number of groups, 1 or more. |
Referenced by blender::io::obj::OBJMesh::calc_smooth_groups().
void BKE_mesh_edge_loop_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MEdge * | medge, | ||
int | totedge, | ||
const struct MPoly * | mpoly, | ||
int | totpoly, | ||
const struct MLoop * | mloop, | ||
int | totloop | ||
) |
Generates a map where the key is the edge and the value is a list of loops that use that edge. Loops indices of a same poly are contiguous and in winding order. The lists are allocated from one memory pool.
void BKE_mesh_edge_poly_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MEdge * | medge, | ||
int | totedge, | ||
const struct MPoly * | mpoly, | ||
int | totpoly, | ||
const struct MLoop * | mloop, | ||
int | totloop | ||
) |
Generates a map where the key is the edge and the value is a list of polygons that use that edge. The lists are allocated from one memory pool.
Referenced by BKE_mesh_remap_calc_loops_from_mesh(), and SCULPT_geodesic_mesh_create().
void BKE_mesh_loop_islands_add | ( | MeshIslandStore * | island_store, |
int | item_num, | ||
const int * | items_indices, | ||
int | num_island_items, | ||
int * | island_item_indices, | ||
int | num_innercut_items, | ||
int * | innercut_item_indices | ||
) |
Definition at line 877 of file mesh_mapping.c.
References BLI_memarena_alloc(), MeshElemMap::count, MeshElemMap::indices, MeshIslandStore::innercuts, MeshIslandStore::islands, MeshIslandStore::islands_num, MeshIslandStore::islands_num_alloc, MeshIslandStore::items_to_islands, MeshIslandStore::mem, and UNLIKELY.
Referenced by mesh_calc_islands_loop_poly_uv().
void BKE_mesh_loop_islands_clear | ( | MeshIslandStore * | island_store | ) |
Definition at line 849 of file mesh_mapping.c.
References BLI_memarena_clear(), MeshIslandStore::innercut_type, MeshIslandStore::innercuts, MeshIslandStore::island_type, MeshIslandStore::islands, MeshIslandStore::islands_num, MeshIslandStore::islands_num_alloc, MeshIslandStore::item_type, MeshIslandStore::items_to_islands, MeshIslandStore::items_to_islands_num, MeshIslandStore::mem, MISLAND_TYPE_NONE, and NULL.
Referenced by mesh_calc_islands_loop_poly_uv().
void BKE_mesh_loop_islands_free | ( | MeshIslandStore * | island_store | ) |
Definition at line 869 of file mesh_mapping.c.
References BLI_memarena_free(), MeshIslandStore::mem, and NULL.
Referenced by BKE_mesh_remap_calc_loops_from_mesh().
void BKE_mesh_loop_islands_init | ( | MeshIslandStore * | island_store, |
short | item_type, | ||
int | items_num, | ||
short | island_type, | ||
short | innercut_type | ||
) |
Definition at line 815 of file mesh_mapping.c.
References BLI_assert, BLI_memarena_alloc(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, ELEM, MeshIslandStore::innercut_type, MeshIslandStore::innercuts, MeshIslandStore::island_type, MeshIslandStore::islands, MeshIslandStore::islands_num_alloc, MeshIslandStore::item_type, MeshIslandStore::items_to_islands, MeshIslandStore::items_to_islands_num, MeshIslandStore::mem, MISLAND_DEFAULT_BUFSIZE, MISLAND_TYPE_EDGE, MISLAND_TYPE_LOOP, MISLAND_TYPE_POLY, MISLAND_TYPE_VERT, and NULL.
Referenced by mesh_calc_islands_loop_poly_uv().
void BKE_mesh_origindex_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
int | totsource, | ||
const int * | final_origindex, | ||
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.
totsource | The total number of elements that final_origindex points to. |
totfinal | The size of final_origindex |
final_origindex | The size of the final array. |
totsource
could be totpoly
, totfinal
could be tottessface
and final_origindex
its ORIGINDEX custom-data. This would allow an MPoly to loop over its tessfaces. Definition at line 481 of file mesh_mapping.c.
References BLI_assert, MeshElemMap::count, indices, MeshElemMap::indices, map, MEM_callocN, MEM_mallocN, and ORIGINDEX_NONE.
void BKE_mesh_origindex_map_create_looptri | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MPoly * | mpoly, | ||
int | mpoly_num, | ||
const struct MLoopTri * | looptri, | ||
int | looptri_num | ||
) |
A version of BKE_mesh_origindex_map_create that takes a looptri array. Making a poly -> looptri map.
Referenced by BKE_mesh_remap_calc_loops_from_mesh().
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], | ||
bool | selected, | ||
bool | use_winding | ||
) |
Referenced by precalc_uv_layer(), ss_sync_from_uv(), and blender::io::obj::OBJMesh::store_uv_coords_and_indices().
Definition at line 167 of file mesh_mapping.c.
References UvVertMap::buf, MEM_freeN, and UvVertMap::vert.
Referenced by BKE_mesh_uv_vert_map_create(), BM_uv_vert_map_create(), precalc_uv_layer(), ss_sync_from_uv(), and blender::io::obj::OBJMesh::store_uv_coords_and_indices().
Definition at line 162 of file mesh_mapping.c.
References v, and UvVertMap::vert.
Referenced by get_face_uv_map_vert(), precalc_uv_layer(), ss_sync_from_uv(), and blender::io::obj::OBJMesh::store_uv_coords_and_indices().
void BKE_mesh_vert_edge_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MEdge * | medge, | ||
int | totvert, | ||
int | totedge | ||
) |
Generates a map where the key is the vertex and the value is a list of edges that use that vertex as an endpoint. The lists are allocated from one memory pool.
Referenced by base_skin(), BKE_mesh_remap_calc_edges_from_mesh(), modifier_skin_armature_create(), SCULPT_geodesic_mesh_create(), and vgroup_smooth_subset().
void BKE_mesh_vert_edge_vert_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MEdge * | medge, | ||
int | totvert, | ||
int | totedge | ||
) |
A version of BKE_mesh_vert_edge_map_create that references connected vertices directly (not their edges).
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 | ||
) |
Generates a map where the key is the vertex and the value is a list of loops that use that vertex as a corner. The lists are allocated from one memory pool.
Referenced by BKE_mesh_merge_customdata_for_apply_modifier(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_remesh_reproject_vertex_paint(), MeshFairingContext::MeshFairingContext(), and vertex_paint_init_session_data().
void BKE_mesh_vert_looptri_map_create | ( | MeshElemMap ** | r_map, |
int ** | r_mem, | ||
const struct MVert * | mvert, | ||
int | totvert, | ||
const struct MLoopTri * | mlooptri, | ||
int | totlooptri, | ||
const struct MLoop * | mloop, | ||
int | totloop | ||
) |
Generates a map where the key is the edge and the value is a list of looptris that use that edge. The lists are allocated from one memory pool.
Referenced by dynamicPaint_createUVSurface().
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 | ||
) |
Generates a map where the key is the vertex and the value is a list of polys that use that vertex as a corner. The lists are allocated from one memory pool.
Referenced by BKE_mesh_merge_verts(), BKE_mesh_remap_calc_loops_from_mesh(), multires_reshape_apply_base_refit_base_mesh(), sculpt_update_object(), and vertex_paint_init_session_data().