Blender  V3.3
Classes | Typedefs | Enumerations | Functions
BKE_mesh_remap.h File Reference

Go to the source code of this file.

Classes

struct  MeshPairRemapItem
 
struct  MeshPairRemap
 

Typedefs

typedef struct MeshPairRemapItem MeshPairRemapItem
 
typedef struct MeshPairRemap MeshPairRemap
 

Enumerations

enum  {
  MREMAP_USE_VERT = 1 << 4 , MREMAP_USE_EDGE = 1 << 5 , MREMAP_USE_LOOP = 1 << 6 , MREMAP_USE_POLY = 1 << 7 ,
  MREMAP_USE_NEAREST = 1 << 8 , MREMAP_USE_NORPROJ = 1 << 9 , MREMAP_USE_INTERP = 1 << 10 , MREMAP_USE_NORMAL = 1 << 11 ,
  MREMAP_MODE_VERT = 1 << 24 , MREMAP_MODE_VERT_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_VERT | MREMAP_USE_NEAREST , MREMAP_MODE_VERT_EDGE_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_EDGE | MREMAP_USE_NEAREST , MREMAP_MODE_VERT_EDGEINTERP_NEAREST ,
  MREMAP_MODE_VERT_POLY_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NEAREST , MREMAP_MODE_VERT_POLYINTERP_NEAREST , MREMAP_MODE_VERT_POLYINTERP_VNORPROJ , MREMAP_MODE_EDGE = 1 << 25 ,
  MREMAP_MODE_EDGE_VERT_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_VERT | MREMAP_USE_NEAREST , MREMAP_MODE_EDGE_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_EDGE | MREMAP_USE_NEAREST , MREMAP_MODE_EDGE_POLY_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_POLY | MREMAP_USE_NEAREST , MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ ,
  MREMAP_MODE_LOOP = 1 << 26 , MREMAP_MODE_LOOP_NEAREST_LOOPNOR , MREMAP_MODE_LOOP_NEAREST_POLYNOR , MREMAP_MODE_LOOP_POLY_NEAREST = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NEAREST ,
  MREMAP_MODE_LOOP_POLYINTERP_NEAREST , MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ , MREMAP_MODE_POLY = 1 << 27 , MREMAP_MODE_POLY_NEAREST = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NEAREST ,
  MREMAP_MODE_POLY_NOR = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NORMAL , MREMAP_MODE_POLY_POLYINTERP_PNORPROJ , MREMAP_MODE_TOPOLOGY = MREMAP_MODE_VERT | MREMAP_MODE_EDGE | MREMAP_MODE_LOOP | MREMAP_MODE_POLY
}
 

Functions

void BKE_mesh_remap_init (MeshPairRemap *map, int items_num)
 
void BKE_mesh_remap_free (MeshPairRemap *map)
 
void BKE_mesh_remap_item_define_invalid (MeshPairRemap *map, int index)
 
void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes (int vert_mode, int edge_mode, int loop_mode, int poly_mode, struct CustomData_MeshMasks *cddata_mask)
 
float BKE_mesh_remap_calc_difference_from_mesh (const struct SpaceTransform *space_transform, const struct MVert *verts_dst, int numverts_dst, struct Mesh *me_src)
 
void BKE_mesh_remap_find_best_match_from_mesh (const struct MVert *verts_dst, int numverts_dst, struct Mesh *me_src, struct SpaceTransform *r_space_transform)
 
void BKE_mesh_remap_calc_verts_from_mesh (int mode, const struct SpaceTransform *space_transform, float max_dist, float ray_radius, const struct MVert *verts_dst, int numverts_dst, bool dirty_nors_dst, struct Mesh *me_src, struct Mesh *me_dst, MeshPairRemap *r_map)
 
void BKE_mesh_remap_calc_edges_from_mesh (int mode, const struct SpaceTransform *space_transform, float max_dist, float ray_radius, const struct MVert *verts_dst, int numverts_dst, const struct MEdge *edges_dst, int numedges_dst, bool dirty_nors_dst, struct Mesh *me_src, struct Mesh *me_dst, MeshPairRemap *r_map)
 
void BKE_mesh_remap_calc_loops_from_mesh (int mode, const struct SpaceTransform *space_transform, float max_dist, float ray_radius, struct Mesh *mesh_dst, struct MVert *verts_dst, int numverts_dst, struct MEdge *edges_dst, int numedges_dst, struct MLoop *loops_dst, int numloops_dst, struct MPoly *polys_dst, int numpolys_dst, struct CustomData *ldata_dst, bool use_split_nors_dst, float split_angle_dst, bool dirty_nors_dst, struct Mesh *me_src, MeshRemapIslandsCalc gen_islands_src, float islands_precision_src, struct MeshPairRemap *r_map)
 
void BKE_mesh_remap_calc_polys_from_mesh (int mode, const struct SpaceTransform *space_transform, float max_dist, float ray_radius, struct Mesh *mesh_dst, struct MVert *verts_dst, struct MLoop *loops_dst, struct MPoly *polys_dst, int numpolys_dst, struct Mesh *me_src, struct MeshPairRemap *r_map)
 

Typedef Documentation

◆ MeshPairRemap

typedef struct MeshPairRemap MeshPairRemap

◆ MeshPairRemapItem

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MREMAP_USE_VERT 
MREMAP_USE_EDGE 
MREMAP_USE_LOOP 
MREMAP_USE_POLY 
MREMAP_USE_NEAREST 
MREMAP_USE_NORPROJ 
MREMAP_USE_INTERP 
MREMAP_USE_NORMAL 
MREMAP_MODE_VERT 
MREMAP_MODE_VERT_NEAREST 
MREMAP_MODE_VERT_EDGE_NEAREST 
MREMAP_MODE_VERT_EDGEINTERP_NEAREST 
MREMAP_MODE_VERT_POLY_NEAREST 
MREMAP_MODE_VERT_POLYINTERP_NEAREST 
MREMAP_MODE_VERT_POLYINTERP_VNORPROJ 
MREMAP_MODE_EDGE 
MREMAP_MODE_EDGE_VERT_NEAREST 
MREMAP_MODE_EDGE_NEAREST 
MREMAP_MODE_EDGE_POLY_NEAREST 
MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ 
MREMAP_MODE_LOOP 
MREMAP_MODE_LOOP_NEAREST_LOOPNOR 
MREMAP_MODE_LOOP_NEAREST_POLYNOR 
MREMAP_MODE_LOOP_POLY_NEAREST 
MREMAP_MODE_LOOP_POLYINTERP_NEAREST 
MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ 
MREMAP_MODE_POLY 
MREMAP_MODE_POLY_NEAREST 
MREMAP_MODE_POLY_NOR 
MREMAP_MODE_POLY_POLYINTERP_PNORPROJ 
MREMAP_MODE_TOPOLOGY 

Definition at line 53 of file BKE_mesh_remap.h.

Function Documentation

◆ BKE_mesh_remap_calc_difference_from_mesh()

float BKE_mesh_remap_calc_difference_from_mesh ( const struct SpaceTransform space_transform,
const struct MVert verts_dst,
int  numverts_dst,
struct Mesh me_src 
)

Compute a value of the difference between both given meshes. The smaller the result, the better the match.

We return the inverse of the average of the inversed shortest distance from each dst vertex to src ones. In other words, beyond a certain (relatively small) distance, all differences have more or less the same weight in final result, which allows to reduce influence of a few high differences, in favor of a global good matching.

◆ BKE_mesh_remap_calc_edges_from_mesh()

void BKE_mesh_remap_calc_edges_from_mesh ( int  mode,
const struct SpaceTransform space_transform,
float  max_dist,
float  ray_radius,
const struct MVert verts_dst,
int  numverts_dst,
const struct MEdge edges_dst,
int  numedges_dst,
bool  dirty_nors_dst,
struct Mesh me_src,
struct Mesh me_dst,
MeshPairRemap r_map 
)

◆ BKE_mesh_remap_calc_loops_from_mesh()

void BKE_mesh_remap_calc_loops_from_mesh ( int  mode,
const struct SpaceTransform space_transform,
float  max_dist,
float  ray_radius,
struct Mesh mesh_dst,
struct MVert verts_dst,
int  numverts_dst,
struct MEdge edges_dst,
int  numedges_dst,
struct MLoop loops_dst,
int  numloops_dst,
struct MPoly polys_dst,
int  numpolys_dst,
struct CustomData ldata_dst,
bool  use_split_nors_dst,
float  split_angle_dst,
bool  dirty_nors_dst,
struct Mesh me_src,
MeshRemapIslandsCalc  gen_islands_src,
float  islands_precision_src,
struct MeshPairRemap r_map 
)

◆ BKE_mesh_remap_calc_polys_from_mesh()

void BKE_mesh_remap_calc_polys_from_mesh ( int  mode,
const struct SpaceTransform space_transform,
float  max_dist,
float  ray_radius,
struct Mesh mesh_dst,
struct MVert verts_dst,
struct MLoop loops_dst,
struct MPoly polys_dst,
int  numpolys_dst,
struct Mesh me_src,
struct MeshPairRemap r_map 
)

◆ BKE_mesh_remap_calc_source_cddata_masks_from_map_modes()

void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes ( int  vert_mode,
int  edge_mode,
int  loop_mode,
int  poly_mode,
struct CustomData_MeshMasks cddata_mask 
)

◆ BKE_mesh_remap_calc_verts_from_mesh()

void BKE_mesh_remap_calc_verts_from_mesh ( int  mode,
const struct SpaceTransform space_transform,
float  max_dist,
float  ray_radius,
const struct MVert verts_dst,
int  numverts_dst,
bool  dirty_nors_dst,
struct Mesh me_src,
struct Mesh me_dst,
MeshPairRemap r_map 
)

◆ BKE_mesh_remap_find_best_match_from_mesh()

void BKE_mesh_remap_find_best_match_from_mesh ( const struct MVert verts_dst,
int  numverts_dst,
struct Mesh me_src,
struct SpaceTransform r_space_transform 
)

Set r_space_transform so that best bbox of dst matches best bbox of src.

Referenced by BKE_object_data_transfer_ex().

◆ BKE_mesh_remap_free()

void BKE_mesh_remap_free ( MeshPairRemap map)

Definition at line 338 of file mesh_remap.c.

References BLI_memarena_free(), map, and NULL.

Referenced by BKE_mesh_remap_init(), and BKE_object_data_transfer_ex().

◆ BKE_mesh_remap_init()

void BKE_mesh_remap_init ( MeshPairRemap map,
int  items_num 
)

◆ BKE_mesh_remap_item_define_invalid()

void BKE_mesh_remap_item_define_invalid ( MeshPairRemap map,
int  index 
)