Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
BKE_customdata.h File Reference

CustomData interface, see also DNA_customdata_types.h. More...

#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
#include "DNA_customdata_types.h"

Go to the source code of this file.

Classes

struct  CDBlockBytes
 
struct  CustomDataTransferLayerMap
 

Macros

#define ORIGINDEX_NONE   -1
 
#define CD_TYPE_AS_MASK(_type)   (eCustomDataMask)((eCustomDataMask)1 << (eCustomDataMask)(_type))
 

Typedefs

typedef uint64_t eCustomDataMask
 
typedef enum eCDAllocType eCDAllocType
 
typedef void(* cd_interp) (const void **sources, const float *weights, const float *sub_weights, int count, void *dest)
 
typedef void(* cd_copy) (const void *source, void *dest, int count)
 
typedef bool(* cd_validate) (void *item, uint totitems, bool do_fixes)
 
typedef void(* cd_datatransfer_interp) (const struct CustomDataTransferLayerMap *laymap, void *dest, const void **sources, const float *weights, int count, float mix_factor)
 
typedef struct CustomDataTransferLayerMap CustomDataTransferLayerMap
 

Enumerations

enum  eCDAllocType {
  CD_ASSIGN = 0 , CD_CALLOC = 1 , CD_DEFAULT = 2 , CD_REFERENCE = 3 ,
  CD_DUPLICATE = 4
}
 
enum  {
  CD_FAKE = 1 << 8 , CD_FAKE_MDEFORMVERT = CD_FAKE | CD_MDEFORMVERT , CD_FAKE_SHAPEKEY , CD_FAKE_SEAM = CD_FAKE | 100 ,
  CD_FAKE_CREASE = CD_FAKE | CD_CREASE , CD_FAKE_BWEIGHT = CD_FAKE | CD_BWEIGHT , CD_FAKE_UV , CD_FAKE_LNOR ,
  CD_FAKE_SHARP = CD_FAKE | 200
}
 
enum  { ME_VERT = 1 << 0 , ME_EDGE = 1 << 1 , ME_POLY = 1 << 2 , ME_LOOP = 1 << 3 }
 
enum  {
  CDT_MIX_NOMIX = -1 , CDT_MIX_TRANSFER = 0 , CDT_MIX_REPLACE_ABOVE_THRESHOLD = 1 , CDT_MIX_REPLACE_BELOW_THRESHOLD = 2 ,
  CDT_MIX_MIX = 16 , CDT_MIX_ADD = 17 , CDT_MIX_SUB = 18 , CDT_MIX_MUL = 19
}
 

Functions

void customData_mask_layers__print (const struct CustomData_MeshMasks *mask)
 
void CustomData_MeshMasks_update (CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
 
bool CustomData_MeshMasks_are_matching (const CustomData_MeshMasks *mask_ref, const CustomData_MeshMasks *mask_required)
 
bool CustomData_layer_has_math (const struct CustomData *data, int layer_n)
 
bool CustomData_layer_has_interp (const struct CustomData *data, int layer_n)
 
bool CustomData_has_math (const struct CustomData *data)
 
bool CustomData_has_interp (const struct CustomData *data)
 
bool CustomData_bmesh_has_free (const struct CustomData *data)
 
bool CustomData_has_referenced (const struct CustomData *data)
 
void CustomData_data_copy_value (int type, const void *source, void *dest)
 
void CustomData_data_mix_value (int type, const void *source, void *dest, int mixmode, float mixfactor)
 
bool CustomData_data_equals (int type, const void *data1, const void *data2)
 
void CustomData_data_initminmax (int type, void *min, void *max)
 
void CustomData_data_dominmax (int type, const void *data, void *min, void *max)
 
void CustomData_data_multiply (int type, void *data, float fac)
 
void CustomData_data_add (int type, void *data1, const void *data2)
 
void CustomData_copy (const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
 
void CustomData_update_typemap (struct CustomData *data)
 
bool CustomData_merge (const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
 
void CustomData_realloc (struct CustomData *data, int totelem)
 
bool CustomData_bmesh_merge (const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, struct BMesh *bm, char htype)
 
void CustomData_reset (struct CustomData *data)
 
void CustomData_free (struct CustomData *data, int totelem)
 
void CustomData_free_typemask (struct CustomData *data, int totelem, eCustomDataMask mask)
 
void CustomData_free_temporary (struct CustomData *data, int totelem)
 
voidCustomData_add_layer (struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
 
voidCustomData_add_layer_named (struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
 
voidCustomData_add_layer_anonymous (struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const struct AnonymousAttributeID *anonymous_id)
 
bool CustomData_free_layer (struct CustomData *data, int type, int totelem, int index)
 
bool CustomData_free_layer_named (struct CustomData *data, const char *name, const int totelem)
 
bool CustomData_free_layer_active (struct CustomData *data, int type, int totelem)
 
void CustomData_free_layers (struct CustomData *data, int type, int totelem)
 
bool CustomData_has_layer (const struct CustomData *data, int type)
 
int CustomData_number_of_layers (const struct CustomData *data, int type)
 
int CustomData_number_of_layers_typemask (const struct CustomData *data, eCustomDataMask mask)
 
voidCustomData_duplicate_referenced_layer (struct CustomData *data, int type, int totelem)
 
voidCustomData_duplicate_referenced_layer_n (struct CustomData *data, int type, int n, int totelem)
 
voidCustomData_duplicate_referenced_layer_named (struct CustomData *data, int type, const char *name, int totelem)
 
voidCustomData_duplicate_referenced_layer_anonymous (CustomData *data, int type, const struct AnonymousAttributeID *anonymous_id, int totelem)
 
bool CustomData_is_referenced_layer (struct CustomData *data, int type)
 
void CustomData_duplicate_referenced_layers (CustomData *data, int totelem)
 
void CustomData_set_only_copy (const struct CustomData *data, eCustomDataMask mask)
 
void CustomData_copy_data (const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
 
void CustomData_copy_data_layer (const CustomData *source, CustomData *dest, int src_layer_index, int dst_layer_index, int src_index, int dst_index, int count)
 
void CustomData_copy_data_named (const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
 
void CustomData_copy_elements (int type, void *src_data_ofs, void *dst_data_ofs, int count)
 
void CustomData_bmesh_copy_data (const struct CustomData *source, struct CustomData *dest, void *src_block, void **dest_block)
 
void CustomData_bmesh_copy_data_exclude_by_type (const struct CustomData *source, struct CustomData *dest, void *src_block, void **dest_block, eCustomDataMask mask_exclude)
 
void CustomData_copy_layer_type_data (const struct CustomData *source, struct CustomData *destination, int type, int source_index, int destination_index, int count)
 
void CustomData_free_elem (struct CustomData *data, int index, int count)
 
void CustomData_interp (const struct CustomData *source, struct CustomData *dest, const int *src_indices, const float *weights, const float *sub_weights, int count, int dest_index)
 
void CustomData_bmesh_interp_n (struct CustomData *data, const void **src_blocks, const float *weights, const float *sub_weights, int count, void *dst_block_ofs, int n)
 
void CustomData_bmesh_interp (struct CustomData *data, const void **src_blocks, const float *weights, const float *sub_weights, int count, void *dst_block)
 
void CustomData_swap_corners (struct CustomData *data, int index, const int *corner_indices)
 
void CustomData_swap (struct CustomData *data, int index_a, int index_b)
 
voidCustomData_get (const struct CustomData *data, int index, int type)
 
voidCustomData_get_n (const struct CustomData *data, int type, int index, int n)
 
voidCustomData_bmesh_get (const struct CustomData *data, void *block, int type)
 
voidCustomData_bmesh_get_n (const struct CustomData *data, void *block, int type, int n)
 
voidCustomData_bmesh_get_layer_n (const struct CustomData *data, void *block, int n)
 
bool CustomData_set_layer_name (const struct CustomData *data, int type, int n, const char *name)
 
const char * CustomData_get_layer_name (const struct CustomData *data, int type, int n)
 
voidCustomData_get_layer (const struct CustomData *data, int type)
 
voidCustomData_get_layer_n (const struct CustomData *data, int type, int n)
 
voidCustomData_get_layer_named (const struct CustomData *data, int type, const char *name)
 
int CustomData_get_offset (const struct CustomData *data, int type)
 
int CustomData_get_offset_named (const CustomData *data, int type, const char *name)
 
int CustomData_get_n_offset (const struct CustomData *data, int type, int n)
 
int CustomData_get_layer_index (const struct CustomData *data, int type)
 
int CustomData_get_layer_index_n (const struct CustomData *data, int type, int n)
 
int CustomData_get_named_layer_index (const struct CustomData *data, int type, const char *name)
 
int CustomData_get_active_layer_index (const struct CustomData *data, int type)
 
int CustomData_get_render_layer_index (const struct CustomData *data, int type)
 
int CustomData_get_clone_layer_index (const struct CustomData *data, int type)
 
int CustomData_get_stencil_layer_index (const struct CustomData *data, int type)
 
int CustomData_get_named_layer (const struct CustomData *data, int type, const char *name)
 
int CustomData_get_active_layer (const struct CustomData *data, int type)
 
int CustomData_get_render_layer (const struct CustomData *data, int type)
 
int CustomData_get_clone_layer (const struct CustomData *data, int type)
 
int CustomData_get_stencil_layer (const struct CustomData *data, int type)
 
const char * CustomData_get_active_layer_name (const struct CustomData *data, int type)
 
void CustomData_set (const struct CustomData *data, int index, int type, const void *source)
 
void CustomData_bmesh_set (const struct CustomData *data, void *block, int type, const void *source)
 
void CustomData_bmesh_set_n (struct CustomData *data, void *block, int type, int n, const void *source)
 
void CustomData_bmesh_set_layer_n (struct CustomData *data, void *block, int n, const void *source)
 
voidCustomData_set_layer (const struct CustomData *data, int type, void *ptr)
 
voidCustomData_set_layer_n (const struct CustomData *data, int type, int n, void *ptr)
 
void CustomData_set_layer_active (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_render (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_clone (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_stencil (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_active_index (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_render_index (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_clone_index (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_stencil_index (struct CustomData *data, int type, int n)
 
void CustomData_set_layer_flag (struct CustomData *data, int type, int flag)
 
void CustomData_clear_layer_flag (struct CustomData *data, int type, int flag)
 
void CustomData_bmesh_set_default (struct CustomData *data, void **block)
 
void CustomData_bmesh_free_block (struct CustomData *data, void **block)
 
void CustomData_bmesh_free_block_data (struct CustomData *data, void *block)
 
void CustomData_bmesh_free_block_data_exclude_by_type (struct CustomData *data, void *block, eCustomDataMask mask_exclude)
 
void CustomData_to_bmesh_block (const struct CustomData *source, struct CustomData *dest, int src_index, void **dest_block, bool use_default_init)
 
void CustomData_from_bmesh_block (const struct CustomData *source, struct CustomData *dest, void *src_block, int dest_index)
 
void CustomData_file_write_info (int type, const char **r_struct_name, int *r_struct_num)
 
int CustomData_sizeof (int type)
 
const char * CustomData_layertype_name (int type)
 
bool CustomData_layertype_is_singleton (int type)
 
bool CustomData_layertype_is_dynamic (int type)
 
int CustomData_layertype_layers_max (int type)
 
void CustomData_set_layer_unique_name (struct CustomData *data, int index)
 
void CustomData_validate_layer_name (const struct CustomData *data, int type, const char *name, char *outname)
 
bool CustomData_verify_versions (struct CustomData *data, int index)
 
void CustomData_bmesh_update_active_layers (struct CustomData *fdata, struct CustomData *ldata)
 
void CustomData_bmesh_init_pool (struct CustomData *data, int totelem, char htype)
 
bool CustomData_layer_validate (struct CustomDataLayer *layer, uint totitems, bool do_fixes)
 
void CustomData_layers__print (struct CustomData *data)
 
void CustomData_external_add (struct CustomData *data, struct ID *id, int type, int totelem, const char *filepath)
 
void CustomData_external_remove (struct CustomData *data, struct ID *id, int type, int totelem)
 
bool CustomData_external_test (struct CustomData *data, int type)
 
void CustomData_external_write (struct CustomData *data, struct ID *id, eCustomDataMask mask, int totelem, int free)
 
void CustomData_external_read (struct CustomData *data, struct ID *id, eCustomDataMask mask, int totelem)
 
void CustomData_external_reload (struct CustomData *data, struct ID *id, eCustomDataMask mask, int totelem)
 
void CustomData_data_transfer (const struct MeshPairRemap *me_remap, const CustomDataTransferLayerMap *laymap)
 
void CustomData_blend_read (struct BlendDataReader *reader, struct CustomData *data, int count)
 
void CustomData_debug_info_from_layers (const struct CustomData *data, const char *indent, struct DynStr *dynstr)
 

Variables

const CustomData_MeshMasks CD_MASK_BAREMESH
 
const CustomData_MeshMasks CD_MASK_BAREMESH_ORIGINDEX
 
const CustomData_MeshMasks CD_MASK_MESH
 
const CustomData_MeshMasks CD_MASK_DERIVEDMESH
 
const CustomData_MeshMasks CD_MASK_BMESH
 
const CustomData_MeshMasks CD_MASK_EVERYTHING
 

Detailed Description

CustomData interface, see also DNA_customdata_types.h.

Definition in file BKE_customdata.h.

Macro Definition Documentation

◆ CD_TYPE_AS_MASK

#define CD_TYPE_AS_MASK (   _type)    (eCustomDataMask)((eCustomDataMask)1 << (eCustomDataMask)(_type))

Definition at line 66 of file BKE_customdata.h.

◆ ORIGINDEX_NONE

#define ORIGINDEX_NONE   -1

Definition at line 46 of file BKE_customdata.h.

Typedef Documentation

◆ cd_copy

typedef void(* cd_copy) (const void *source, void *dest, int count)

Definition at line 72 of file BKE_customdata.h.

◆ cd_datatransfer_interp

typedef void(* cd_datatransfer_interp) (const struct CustomDataTransferLayerMap *laymap, void *dest, const void **sources, const float *weights, int count, float mix_factor)

Definition at line 591 of file BKE_customdata.h.

◆ cd_interp

typedef void(* cd_interp) (const void **sources, const float *weights, const float *sub_weights, int count, void *dest)

Definition at line 70 of file BKE_customdata.h.

◆ cd_validate

typedef bool(* cd_validate) (void *item, uint totitems, bool do_fixes)

Definition at line 73 of file BKE_customdata.h.

◆ CustomDataTransferLayerMap

◆ eCDAllocType

typedef enum eCDAllocType eCDAllocType

Add/copy/merge allocation types.

◆ eCustomDataMask

Definition at line 31 of file BKE_customdata.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ME_VERT 
ME_EDGE 
ME_POLY 
ME_LOOP 

Definition at line 624 of file BKE_customdata.h.

◆ anonymous enum

anonymous enum

How to filter out some elements (to leave untouched). Note those options are highly dependent on type of transferred data!

Enumerator
CDT_MIX_NOMIX 
CDT_MIX_TRANSFER 
CDT_MIX_REPLACE_ABOVE_THRESHOLD 
CDT_MIX_REPLACE_BELOW_THRESHOLD 
CDT_MIX_MIX 
CDT_MIX_ADD 
CDT_MIX_SUB 
CDT_MIX_MUL 

Definition at line 634 of file BKE_customdata.h.

◆ anonymous enum

anonymous enum

Fake CD_LAYERS (those are actually 'real' data stored directly into elements' structs, or otherwise not (directly) accessible to usual CDLayer system).

Enumerator
CD_FAKE 
CD_FAKE_MDEFORMVERT 
CD_FAKE_SHAPEKEY 
CD_FAKE_SEAM 
CD_FAKE_CREASE 
CD_FAKE_BWEIGHT 
CD_FAKE_UV 
CD_FAKE_LNOR 
CD_FAKE_SHARP 

Definition at line 601 of file BKE_customdata.h.

◆ eCDAllocType

Add/copy/merge allocation types.

Enumerator
CD_ASSIGN 

Use the data pointer.

CD_CALLOC 

Allocate blank memory.

CD_DEFAULT 

Allocate and set to default.

CD_REFERENCE 

Use data pointers, set layer flag NOFREE.

CD_DUPLICATE 

Do a full copy of all layers, only allowed if source has same number of elements.

Definition at line 53 of file BKE_customdata.h.

Function Documentation

◆ CustomData_add_layer()

void* CustomData_add_layer ( struct CustomData data,
int  type,
eCDAllocType  alloctype,
void layer,
int  totelem 
)

Adds a data layer of the given type to the CustomData object, optionally backed by an external data array. the different allocation types are defined above. returns the data of the layer.

Definition at line 2776 of file customdata.cc.

References customData_add_layer__internal(), CustomData_update_typemap(), data, CustomDataLayer::data, LayerTypeInfo::defaultname, layerType_getInfo(), and type.

Referenced by blender::bke::add_builtin_type_custom_data_layer_from_init(), add_orco_mesh(), BKE_mesh_calc_edges(), BKE_mesh_calc_edges_legacy(), BKE_mesh_calc_edges_tessface(), BKE_mesh_ensure_facemap_customdata(), BKE_mesh_ensure_skin_customdata(), BKE_mesh_from_metaball(), BKE_mesh_from_pointcloud(), BKE_mesh_nomain_to_mesh(), BKE_mesh_orco_ensure(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remesh_reproject_paint_mask(), BKE_object_defgroup_data_create(), BKE_remesh_reproject_sculpt_face_sets(), BKE_sculpt_color_layer_create_if_needed(), BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_mask_layers_ensure(), BM_data_layer_add(), BM_mesh_bm_from_me(), BM_mesh_bm_to_me(), BM_mesh_bm_to_me_for_eval(), ccgDM_get_edge_data_layer(), ccgDM_get_poly_data_layer(), ccgDM_get_vert_data_layer(), CDDM_copy(), convert_mfaces_to_mpolys(), copy_ccg_data(), customdata_version_242(), data_transfer_dtdata_type_postprocess(), data_transfer_dtdata_type_preprocess(), data_transfer_layersmapping_cdlayers(), data_transfer_layersmapping_cdlayers_multisrc_to_dst(), data_transfer_layersmapping_vgroups(), data_transfer_layersmapping_vgroups_multisrc_to_dst(), deformVerts(), DM_DupPolys(), dm_getEdgeArray(), dm_getLoopArray(), dm_getPolyArray(), dm_getVertArray(), dynamicPaint_Modifier_apply(), ED_mesh_join_objects_exec(), ED_object_facemap_face_add(), ED_object_modifier_convert_psys_to_mesh(), editbmesh_calc_modifiers(), ensure_corner_normal_layer(), ensure_orig_index_layer(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), hair_create_input_mesh(), mesh_add_edges(), mesh_add_loops(), mesh_add_polys(), mesh_add_verts(), mesh_calc_modifiers(), mesh_customdata_custom_splitnormals_add_exec(), mesh_ensure_cdlayers_primary(), mesh_set_custom_normals(), mesh_tessface_calc(), MOD_solidify_extrude_modifyMesh(), modifier_skin_armature_create(), modifyGeometry(), modifyMesh(), multires_create_grids_in_unsubdivided_base_mesh(), multires_ensure_external_read(), multires_subdivide_create_tangent_displacement_linear_grids(), multiresModifier_disp_run(), multiresModifier_subdivide_to_level(), normalEditModifier_do(), blender::io::alembic::read_generated_coordinates(), blender::io::alembic::read_vertex_creases(), SCULPT_dynamic_topology_disable_ex(), sculpt_face_sets_ensure(), skin_set_orig_indices(), and blender::io::stl::STLMeshHelper::to_mesh().

◆ CustomData_add_layer_anonymous()

void* CustomData_add_layer_anonymous ( struct CustomData data,
int  type,
eCDAllocType  alloctype,
void layer,
int  totelem,
const struct AnonymousAttributeID anonymous_id 
)

◆ CustomData_add_layer_named()

void* CustomData_add_layer_named ( struct CustomData data,
int  type,
eCDAllocType  alloctype,
void layer,
int  totelem,
const char *  name 
)

◆ CustomData_blend_read()

void CustomData_blend_read ( struct BlendDataReader reader,
struct CustomData data,
int  count 
)

◆ CustomData_bmesh_copy_data()

void CustomData_bmesh_copy_data ( const struct CustomData source,
struct CustomData dest,
void src_block,
void **  dest_block 
)

◆ CustomData_bmesh_copy_data_exclude_by_type()

void CustomData_bmesh_copy_data_exclude_by_type ( const struct CustomData source,
struct CustomData dest,
void src_block,
void **  dest_block,
eCustomDataMask  mask_exclude 
)

◆ CustomData_bmesh_free_block()

void CustomData_bmesh_free_block ( struct CustomData data,
void **  block 
)

◆ CustomData_bmesh_free_block_data()

void CustomData_bmesh_free_block_data ( struct CustomData data,
void block 
)

◆ CustomData_bmesh_free_block_data_exclude_by_type()

void CustomData_bmesh_free_block_data_exclude_by_type ( struct CustomData data,
void block,
eCustomDataMask  mask_exclude 
)

◆ CustomData_bmesh_get()

void* CustomData_bmesh_get ( const struct CustomData data,
void block,
int  type 
)

◆ CustomData_bmesh_get_layer_n()

void* CustomData_bmesh_get_layer_n ( const struct CustomData data,
void block,
int  n 
)

Gets from the layer at physical index n,

Note
doesn't check type.

Referenced by EDBM_verts_mirror_cache_clear(), and EDBM_verts_mirror_get().

◆ CustomData_bmesh_get_n()

void* CustomData_bmesh_get_n ( const struct CustomData data,
void block,
int  type,
int  n 
)

◆ CustomData_bmesh_has_free()

bool CustomData_bmesh_has_free ( const struct CustomData data)

A non bmesh version would have to check layer->data.

Referenced by BM_mesh_data_free().

◆ CustomData_bmesh_init_pool()

void CustomData_bmesh_init_pool ( struct CustomData data,
int  totelem,
char  htype 
)

◆ CustomData_bmesh_interp()

void CustomData_bmesh_interp ( struct CustomData data,
const void **  src_blocks,
const float weights,
const float sub_weights,
int  count,
void dst_block 
)

◆ CustomData_bmesh_interp_n()

void CustomData_bmesh_interp_n ( struct CustomData data,
const void **  src_blocks,
const float weights,
const float sub_weights,
int  count,
void dst_block_ofs,
int  n 
)
Note
src_blocks_ofs & dst_block_ofs must be pointers to the data, offset by layer->offset already.

Definition at line 4071 of file customdata.cc.

References BLI_assert, count, data, LayerTypeInfo::interp, layerType_getInfo(), and CustomDataLayer::type.

Referenced by bm_edge_collapse_loop_customdata(), bm_vert_loop_groups_data_layer_merge__single(), bm_vert_loop_groups_data_layer_merge_weights__single(), and CustomData_bmesh_interp().

◆ CustomData_bmesh_merge()

bool CustomData_bmesh_merge ( const struct CustomData source,
struct CustomData dest,
eCustomDataMask  mask,
eCDAllocType  alloctype,
struct BMesh bm,
char  htype 
)

BMesh version of CustomData_merge; merges the layouts of source and dest, then goes through the mesh and makes sure all the custom-data blocks are consistent with the new layout.

Referenced by BM_mesh_bm_from_me().

◆ CustomData_bmesh_set()

void CustomData_bmesh_set ( const struct CustomData data,
void block,
int  type,
const void source 
)

◆ CustomData_bmesh_set_default()

void CustomData_bmesh_set_default ( struct CustomData data,
void **  block 
)

◆ CustomData_bmesh_set_layer_n()

void CustomData_bmesh_set_layer_n ( struct CustomData data,
void block,
int  n,
const void source 
)

Sets the data of the block at physical layer n. no real type checking is performed.

Definition at line 4054 of file customdata.cc.

References LayerTypeInfo::copy, CustomData_bmesh_get_layer_n(), data, dest, layerType_getInfo(), and LayerTypeInfo::size.

◆ CustomData_bmesh_set_n()

void CustomData_bmesh_set_n ( struct CustomData data,
void block,
int  type,
int  n,
const void source 
)

◆ CustomData_bmesh_update_active_layers()

void CustomData_bmesh_update_active_layers ( struct CustomData fdata,
struct CustomData ldata 
)

◆ CustomData_clear_layer_flag()

void CustomData_clear_layer_flag ( struct CustomData data,
int  type,
int  flag 
)

Definition at line 2635 of file customdata.cc.

References data, and type.

Referenced by mesh_wrapper_ensure_subdivision(), modifyMesh(), and triangulate_mesh().

◆ CustomData_copy()

void CustomData_copy ( const struct CustomData source,
struct CustomData dest,
eCustomDataMask  mask,
eCDAllocType  alloctype,
int  totelem 
)

◆ CustomData_copy_data()

void CustomData_copy_data ( const struct CustomData source,
struct CustomData dest,
int  source_index,
int  dest_index,
int  count 
)

◆ CustomData_copy_data_layer()

void CustomData_copy_data_layer ( const CustomData source,
CustomData dest,
int  src_layer_index,
int  dst_layer_index,
int  src_index,
int  dst_index,
int  count 
)

◆ CustomData_copy_data_named()

void CustomData_copy_data_named ( const struct CustomData source,
struct CustomData dest,
int  source_index,
int  dest_index,
int  count 
)

Referenced by join_mesh_single().

◆ CustomData_copy_elements()

void CustomData_copy_elements ( int  type,
void src_data_ofs,
void dst_data_ofs,
int  count 
)

◆ CustomData_copy_layer_type_data()

void CustomData_copy_layer_type_data ( const struct CustomData source,
struct CustomData destination,
int  type,
int  source_index,
int  destination_index,
int  count 
)

Copies data of a single layer of a given type.

Referenced by copy_ccg_data(), and blender::geometry::customdata_weld().

◆ CustomData_data_add()

void CustomData_data_add ( int  type,
void data1,
const void data2 
)

◆ CustomData_data_copy_value()

void CustomData_data_copy_value ( int  type,
const void source,
void dest 
)

Copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to another, while not overwriting anything else (e.g. flags). probably only implemented for mloopuv/mloopcol, for now.

Definition at line 3939 of file customdata.cc.

References CDT_MIX_NOMIX, LayerTypeInfo::copyvalue, dest, layerType_getInfo(), LayerTypeInfo::size, and type.

Referenced by bm_loop_customdata_merge(), bmo_average_vert_facedata_exec(), and bmo_collapsecon_do_layer().

◆ CustomData_data_dominmax()

void CustomData_data_dominmax ( int  type,
const void data,
void min,
void max 
)

◆ CustomData_data_equals()

bool CustomData_data_equals ( int  type,
const void data1,
const void data2 
)

Compares if data1 is equal to data2. type is a valid CustomData type enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare the data, if it exists, otherwise #memcmp is used.

Definition at line 3973 of file customdata.cc.

References data1, data2, LayerTypeInfo::equal, layerType_getInfo(), LayerTypeInfo::size, and type.

Referenced by bm_edge_collapse_loop_customdata(), BM_edge_is_contiguous_loop_cd(), bm_loop_customdata_merge(), bm_loop_walk_data(), bmw_UVEdgeWalker_step(), and contig_ldata_across_loops().

◆ CustomData_data_initminmax()

void CustomData_data_initminmax ( int  type,
void min,
void max 
)

◆ CustomData_data_mix_value()

void CustomData_data_mix_value ( int  type,
const void source,
void dest,
int  mixmode,
float  mixfactor 
)

Mixes the "value" (e.g. mloopuv uv or mloopcol colors) from one block into another, while not overwriting anything else (e.g. flags).

Definition at line 3955 of file customdata.cc.

References LayerTypeInfo::copyvalue, dest, layerType_getInfo(), LayerTypeInfo::size, and type.

Referenced by bm_loop_customdata_merge(), customdata_data_transfer_interp_generic(), and customdata_data_transfer_interp_normal_normals().

◆ CustomData_data_multiply()

void CustomData_data_multiply ( int  type,
void data,
float  fac 
)

◆ CustomData_data_transfer()

void CustomData_data_transfer ( const struct MeshPairRemap me_remap,
const CustomDataTransferLayerMap laymap 
)

Those functions assume src_n and dst_n layers of given type exist in resp. src and dst.

Referenced by BKE_object_data_transfer_ex().

◆ CustomData_debug_info_from_layers()

void CustomData_debug_info_from_layers ( const struct CustomData data,
const char *  indent,
struct DynStr dynstr 
)

Use to inspect mesh data when debugging.

Referenced by BKE_mesh_debug_info(), and BM_mesh_debug_info().

◆ CustomData_duplicate_referenced_layer()

void* CustomData_duplicate_referenced_layer ( struct CustomData data,
int  type,
int  totelem 
)

◆ CustomData_duplicate_referenced_layer_anonymous()

void* CustomData_duplicate_referenced_layer_anonymous ( CustomData data,
int  type,
const struct AnonymousAttributeID anonymous_id,
int  totelem 
)

◆ CustomData_duplicate_referenced_layer_n()

void* CustomData_duplicate_referenced_layer_n ( struct CustomData data,
int  type,
int  n,
int  totelem 
)

◆ CustomData_duplicate_referenced_layer_named()

void* CustomData_duplicate_referenced_layer_named ( struct CustomData data,
int  type,
const char *  name,
int  totelem 
)

◆ CustomData_duplicate_referenced_layers()

void CustomData_duplicate_referenced_layers ( CustomData data,
int  totelem 
)

Duplicate all the layers with flag NOFREE, and remove the flag from duplicated layers.

Definition at line 3020 of file customdata.cc.

References customData_duplicate_referenced_layer_index(), data, and CustomDataLayer::data.

Referenced by BKE_mesh_split_faces(), blender::nodes::node_geo_extrude_mesh_cc::expand_mesh(), and blender::bke::CurvesGeometry::reverse_curves().

◆ CustomData_external_add()

void CustomData_external_add ( struct CustomData data,
struct ID id,
int  type,
int  totelem,
const char *  filepath 
)

◆ CustomData_external_read()

void CustomData_external_read ( struct CustomData data,
struct ID id,
eCustomDataMask  mask,
int  totelem 
)

◆ CustomData_external_reload()

void CustomData_external_reload ( struct CustomData data,
struct ID id,
eCustomDataMask  mask,
int  totelem 
)

◆ CustomData_external_remove()

void CustomData_external_remove ( struct CustomData data,
struct ID id,
int  type,
int  totelem 
)

◆ CustomData_external_test()

bool CustomData_external_test ( struct CustomData data,
int  type 
)

◆ CustomData_external_write()

void CustomData_external_write ( struct CustomData data,
struct ID id,
eCustomDataMask  mask,
int  totelem,
int  free 
)

◆ CustomData_file_write_info()

void CustomData_file_write_info ( int  type,
const char **  r_struct_name,
int *  r_struct_num 
)

◆ CustomData_free()

void CustomData_free ( struct CustomData data,
int  totelem 
)

◆ CustomData_free_elem()

void CustomData_free_elem ( struct CustomData data,
int  index,
int  count 
)

◆ CustomData_free_layer()

bool CustomData_free_layer ( struct CustomData data,
int  type,
int  totelem,
int  index 
)

◆ CustomData_free_layer_active()

bool CustomData_free_layer_active ( struct CustomData data,
int  type,
int  totelem 
)

Frees the layer index with the give type. returns 1 on success, 0 if no layer with the given type is found.

In edit-mode, use #EDBM_data_layer_free instead of this function.

Definition at line 2895 of file customdata.cc.

References CustomData_free_layer(), CustomData_get_active_layer_index(), data, and type.

Referenced by BKE_object_defgroup_remove_all_ex(), blo_do_versions_250(), BM_data_layer_free(), modifier_skin_customdata_delete(), multires_customdata_delete(), and object_defgroup_remove_common().

◆ CustomData_free_layer_named()

bool CustomData_free_layer_named ( struct CustomData data,
const char *  name,
const int  totelem 
)

◆ CustomData_free_layers()

void CustomData_free_layers ( struct CustomData data,
int  type,
int  totelem 
)

◆ CustomData_free_temporary()

void CustomData_free_temporary ( struct CustomData data,
int  totelem 
)

◆ CustomData_free_typemask()

void CustomData_free_typemask ( struct CustomData data,
int  totelem,
eCustomDataMask  mask 
)

Same as above, but only frees layers which matches the given mask.

Definition at line 2387 of file customdata.cc.

References CD_TYPE_AS_MASK, CustomData_external_free(), customData_free_layer__internal(), CustomData_reset(), data, mask(), MEM_freeN, and CustomDataLayer::type.

Referenced by BKE_mesh_nomain_to_mesh().

◆ CustomData_from_bmesh_block()

void CustomData_from_bmesh_block ( const struct CustomData source,
struct CustomData dest,
void src_block,
int  dest_index 
)

◆ CustomData_get()

void* CustomData_get ( const struct CustomData data,
int  index,
int  type 
)

Gets a pointer to the data element at index from the first layer of type.

Returns
NULL if there is no layer of type.

Referenced by bm_corners_to_loops_ex(), cloth_apply_vgroup(), join_mesh_single(), psys_face_mat(), and psys_get_dupli_texture().

◆ CustomData_get_active_layer()

int CustomData_get_active_layer ( const struct CustomData data,
int  type 
)

◆ CustomData_get_active_layer_index()

int CustomData_get_active_layer_index ( const struct CustomData data,
int  type 
)

◆ CustomData_get_active_layer_name()

const char* CustomData_get_active_layer_name ( const struct CustomData data,
int  type 
)

Returns name of the active layer of the given type or NULL if no such active layer is defined.

Referenced by get_mesh_active_uvlayer_name(), object_curves_empty_hair_add_exec(), and blender::ed::curves::surface_set::surface_set_exec().

◆ CustomData_get_clone_layer()

int CustomData_get_clone_layer ( const struct CustomData data,
int  type 
)

◆ CustomData_get_clone_layer_index()

int CustomData_get_clone_layer_index ( const struct CustomData data,
int  type 
)

◆ CustomData_get_layer()

void* CustomData_get_layer ( const struct CustomData data,
int  type 
)

Gets a pointer to the active or first layer of type.

Returns
NULL if there is no layer of type.

Referenced by add_orco_mesh(), blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), bake_targets_populate_pixels_color_attributes(), base_skin(), BKE_keyblock_mesh_calc_normals(), BKE_mesh_calc_edges_tessface(), BKE_mesh_calc_loop_tangent_single(), BKE_mesh_calc_loop_tangents(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_foreach_mapped_edge(), BKE_mesh_foreach_mapped_face_center(), BKE_mesh_foreach_mapped_loop(), BKE_mesh_foreach_mapped_subdiv_face_center(), BKE_mesh_foreach_mapped_vert(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_nomain_to_mesh(), BKE_mesh_polygon_flip(), BKE_mesh_polygon_flip_ex(), BKE_mesh_polygons_flip(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remesh_reproject_paint_mask(), BKE_mesh_update_customdata_pointers(), BKE_object_as_kdtree(), BKE_object_data_transfer_ex(), BKE_remesh_reproject_sculpt_face_sets(), BKE_remesh_reproject_vertex_paint(), BKE_sculpt_ensure_orig_mesh_data(), BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_mask_layers_ensure(), BKE_sculpt_multires_active(), BKE_sculpt_sync_face_sets_visibility_to_base_mesh(), BKE_sculpt_sync_face_sets_visibility_to_grids(), BKE_shrinkwrap_init_tree(), BKE_subdiv_ccg_mask_init_from_paint(), blo_do_versions_280(), CDDM_copy(), cdDM_from_mesh_ex(), cloth_from_object(), blender::draw::compute_area_ratio(), contarget_get_mesh_mat(), context_init_grid_pointers(), convert_mfaces_to_mpolys(), GeometryExporter::create_normals(), createFacepa(), data_transfer_dtdata_type_postprocess(), data_transfer_dtdata_type_preprocess(), data_transfer_layersmapping_cdlayers(), data_transfer_layersmapping_generate(), data_transfer_layersmapping_vgroups(), deformVerts(), deformVerts_do(), displacement_init_data(), displaceModifier_do(), DM_get_edge_data_layer(), DM_get_loop_data_layer(), DM_get_poly_data_layer(), DM_get_vert_data_layer(), dm_getEdgeArray(), dm_getLoopArray(), dm_getPolyArray(), dm_getVertArray(), draw_subdiv_topology_info_cb(), DRW_mesh_batch_cache_create_requested(), dynamicPaint_Modifier_apply(), ED_draw_object_facemap(), ED_mesh_pick_face_vert(), ED_mesh_sculpt_color_add(), ED_object_facemap_face_add(), ED_object_facemap_face_remove(), ED_operator_uvmap_mesh(), ED_sculpt_face_sets_find_next_available_id(), ED_sculpt_face_sets_initialize_none_to_id(), editbmesh_calc_modifiers(), ensure_corner_normal_layer(), ensure_displacement_grids(), ensure_mask_grids(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::bke::BuiltinCustomDataLayerProvider::exists(), blender::draw::extract_edituv_stretch_angle_init(), blender::draw::extract_fdots_uv_init(), blender::draw::extract_orco_init(), blender::draw::extract_pos_nor_init_subdiv(), blender::draw::extract_sculpt_data_init(), blender::draw::extract_sculpt_data_init_subdiv(), blender::draw::extract_tan_init_common(), blender::draw::extract_weights_init(), final_skin(), blender::render::texturemargin::generate_margin(), get_levels_from_disps(), blender::io::alembic::get_loop_normals(), blender::nodes::node_geo_extrude_mesh_cc::get_orig_index_layer(), blender::io::obj::OBJMesh::get_poly_deform_group_index(), blender::io::usd::get_vert_creases(), blender::io::alembic::get_vert_creases(), get_vertex_group(), give_parvert(), imapaint_pick_uv(), blender::io::obj::obj_importer_test::import_and_check(), init_user_data(), Freestyle::BlenderFileLoader::insertShapeNode(), lattice_deform_coords_impl(), loop_to_vertex_colors_exec(), make_duplis_faces(), make_duplis_verts(), mask_init_data(), mesh_calc_modifiers(), mesh_calc_tri_tessface(), mesh_ensure_cdlayers_primary(), mesh_init_origspace(), mesh_join_offset_face_sets_ID(), mesh_loops_to_tessdata(), mesh_merge_transform(), mesh_render_data_create(), mesh_render_data_update_normals(), mesh_set_custom_normals(), mesh_tessface_calc(), mesh_wrapper_ensure_subdivision(), MOD_solidify_extrude_modifyMesh(), modifier_skin_armature_create(), modifyMesh(), multires_apply_smat(), multires_apply_uniform_scale(), multires_del_higher(), multires_ensure_external_read(), multires_modifier_update_hidden(), multires_modifier_update_mdisps(), multires_output_hidden_to_ccgdm(), multires_reshape_context_create_from_object(), multires_set_tot_mdisps(), multires_subdivide_create_object_space_linear_grids(), multires_topology_changed(), multiresModifier_del_levels(), multiresModifier_disp_run(), multiresModifier_set_levels_from_disps(), normalEditModifier_do(), object_fmap_remap_object_mode(), object_fmap_remove_object_mode(), paint_mask_slice_exec(), paintface_flush_flags(), paintvert_flush_flags(), partialvis_update_mesh(), pbvh_has_face_sets(), pbvh_has_mask(), pbvh_update_draw_buffer_cb(), pbvh_vertex_iter_init(), pointdensity_cache_vertex_weight(), polygons_check_flip(), proj_paint_face_lookup_init(), proj_paint_layer_clone_init(), project_paint_begin(), project_paint_clone_face_skip(), project_paint_prepare_all_faces(), psys_calc_dmcache(), psys_face_mat(), psys_map_index_on_dm(), psys_mat_hair_to_orco(), psys_particle_dm_face_lookup(), psys_particle_on_dm(), psys_thread_context_init_distribute(), RE_bake_pixels_populate(), blender::io::alembic::read_generated_coordinates(), SCULPT_dynamic_topology_disable_ex(), sculpt_gesture_trim_end(), sculpt_undo_face_sets_push(), sculpt_undo_restore_face_sets(), sculpt_update_object(), set_ccgdm_all_geometry(), set_vertex_data_from_orco(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), blender::io::obj::OBJMesh::store_uv_coords_and_indices(), subdiv_mesh_ctx_cache_custom_data_layers(), subdivide_base(), triangulate_mesh(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::bke::BuiltinCustomDataLayerProvider::try_create(), blender::bke::pbvh::pixels::update_pixels(), vertex_to_loop_colors_exec(), weightvg_do_mask(), and blender::io::alembic::write_generated_coordinates().

◆ CustomData_get_layer_index()

int CustomData_get_layer_index ( const struct CustomData data,
int  type 
)

◆ CustomData_get_layer_index_n()

int CustomData_get_layer_index_n ( const struct CustomData data,
int  type,
int  n 
)

◆ CustomData_get_layer_n()

void* CustomData_get_layer_n ( const struct CustomData data,
int  type,
int  n 
)

◆ CustomData_get_layer_name()

const char* CustomData_get_layer_name ( const struct CustomData data,
int  type,
int  n 
)

◆ CustomData_get_layer_named()

void* CustomData_get_layer_named ( const struct CustomData data,
int  type,
const char *  name 
)

◆ CustomData_get_n()

void* CustomData_get_n ( const struct CustomData data,
int  type,
int  index,
int  n 
)

Referenced by bm_corners_to_loops_ex().

◆ CustomData_get_n_offset()

int CustomData_get_n_offset ( const struct CustomData data,
int  type,
int  n 
)

◆ CustomData_get_named_layer()

int CustomData_get_named_layer ( const struct CustomData data,
int  type,
const char *  name 
)

◆ CustomData_get_named_layer_index()

int CustomData_get_named_layer_index ( const struct CustomData data,
int  type,
const char *  name 
)

◆ CustomData_get_offset()

int CustomData_get_offset ( const struct CustomData data,
int  type 
)

Referenced by armature_deform_coords_impl(), bevel_harden_normals(), BKE_object_defgroup_clear(), BKE_pbvh_bmesh_update_topology(), BKE_view_layer_filter_edit_mesh_has_uvs(), BM_custom_loop_normals_from_vector_layer(), BM_custom_loop_normals_to_vector_layer(), BM_edge_split(), BM_face_interp_multires(), BM_face_multires_bounds_smooth(), BM_face_normal_flip(), BM_face_split(), BM_face_triangulate(), BM_faces_join(), BM_faces_join_pair(), BM_lnorspace_err(), BM_lnorspace_rebuild(), BM_lnorspacearr_store(), BM_log_all_added(), BM_log_before_all_removed(), bm_log_faces_restore(), bm_log_vert_values_swap(), bm_log_verts_restore(), bm_log_verts_unmake(), BM_loop_interp_multires(), BM_loop_normal_editdata_array_init(), BM_mesh_bm_from_me(), BM_mesh_bm_to_me(), BM_mesh_bm_to_me_for_eval(), BM_mesh_calc_uvs_cube(), BM_mesh_remap(), BM_mesh_wireframe(), bm_to_mesh_shape(), bm_to_mesh_vertex_map(), BM_uv_element_map_create(), BM_uv_vert_map_create(), BMD_mesh_bm_create(), bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_create_cube_exec(), bmo_create_grid_exec(), bmo_create_icosphere_exec(), bmo_create_monkey_exec(), bmo_create_uvsphere_exec(), bmo_poke_exec(), bmo_reverse_faces_exec(), bmo_reverse_uvs_exec(), bmo_rotate_uvs_exec(), bmo_subd_init_shape_info(), bmo_transform_exec(), blender::draw::compute_area_ratio(), construct_param_edge_set_seams(), construct_param_handle(), construct_param_handle_multi(), construct_param_handle_subsurfed(), correct_uv_aspect(), correct_uv_aspect_per_face(), createTransEdge(), createTransMeshVertCData(), createTransUVs(), curve_deform_coords_impl(), cylinder_project_exec(), deformVerts_do(), do_lasso_select_mesh_uv(), ED_mesh_active_dvert_get_em(), ED_uvedit_ensure_uvs(), ED_uvedit_median_multi(), ED_uvedit_minmax_multi(), ED_uvedit_pack_islands_multi(), ED_uvedit_select_all(), ED_uvedit_selected_edges(), ED_uvedit_selected_faces(), ED_uvedit_selected_verts(), ED_uvedit_selectmode_clean(), ED_uvedit_selectmode_flush(), ED_vgroup_mirror(), ED_vgroup_parray_alloc(), ED_vgroup_vert_active_mirror(), edbm_average_normals_exec(), edbm_decimate_exec(), EDBM_select_pick(), edbm_select_ungrouped_exec(), edbm_select_ungrouped_poll(), edbm_set_normals_from_faces_exec(), blender::draw::extract_edituv_data_init_common(), blender::draw::extract_edituv_stretch_angle_init(), blender::draw::extract_fdots_edituv_data_init(), blender::draw::extract_fdots_uv_init(), blender::draw::extract_sculpt_data_init(), blender::draw::extract_skin_roots_init(), blender::draw::extract_weights_init(), face_map_assign_exec(), face_map_remove_from_exec(), fmap_select(), geometry_extract_tag_face_set(), geometry_extract_tag_masked_faces(), get_vert_def_nr(), get_weights_array(), GPU_pbvh_bmesh_buffers_update(), lattice_deform_coords_impl(), mesh_render_data_create(), mesh_render_data_update_normals(), normals_split(), object_defgroup_remove_edit_mode(), object_fmap_remap_edit_mode(), object_fmap_remove_edit_mode(), overlay_edit_mesh_add_ob_to_pass(), pbvh_has_mask(), pbvh_vertex_iter_init(), return_editmesh_vgroup(), sculpt_face_sets_init_face_set_boundary_test(), sculpt_face_sets_init_loop(), SCULPT_vertex_mask_get(), select_linked_delimit_begin(), similar_face_select_exec(), similar_vert_select_exec(), skin_root_mark_exec(), slice_paint_mask(), smart_project_exec(), sphere_project_exec(), stitch_init(), stitch_propagate_uv_final_position(), tc_mesh_customdatacorrect_init_container_generic(), uv_box_select_exec(), uv_circle_select_exec(), uv_find_nearest_edge(), uv_find_nearest_face_ex(), uv_find_nearest_loop_from_edge(), uv_find_nearest_loop_from_vert(), uv_find_nearest_vert(), uv_from_view_exec(), uv_hide_exec(), uv_map_clip_correct_multi(), uv_map_mirror(), uv_mark_seam_exec(), uv_mouse_select_multi(), uv_pin_exec(), uv_remove_doubles_to_selected(), uv_remove_doubles_to_unselected(), uv_reveal_exec(), uv_rip_object(), uv_seams_from_islands_exec(), uv_select_all(), uv_select_edgeloop(), uv_select_edgering(), uv_select_faceloop(), uv_select_flush_from_loop_edge_flag(), uv_select_flush_from_tag_face(), uv_select_flush_from_tag_loop(), uv_select_invert(), uv_select_linked_multi(), uv_select_more_less(), uv_select_overlap(), uv_select_pinned_exec(), uv_select_similar_edge_exec(), uv_select_similar_face_exec(), uv_select_similar_vert_exec(), uv_select_split_exec(), uv_set_connectivity_distance(), uv_shortest_path_pick_exec(), uv_shortest_path_pick_invoke(), uv_shortest_path_select_exec(), uv_snap_uvs_offset(), uv_snap_uvs_to_adjacent_unselected(), uv_snap_uvs_to_cursor(), uv_snap_uvs_to_pixels(), uv_weld_align(), uvedit_center(), uvedit_deselect_flush(), uvedit_have_selection(), uvedit_nearest_uv(), uvedit_select_flush(), uvedit_select_is_any_selected(), uvedit_translate(), uvedit_unwrap_cube_project(), uvedit_uv_align_weld(), uvedit_uv_straighten(), v3d_editvertex_buts(), vgroup_assign_verts(), vgroup_copy_active_to_sel(), vgroup_copy_active_to_sel_single(), vgroup_do_remap(), vgroup_normalize_active_vertex(), and vgroup_select_verts().

◆ CustomData_get_offset_named()

int CustomData_get_offset_named ( const CustomData data,
int  type,
const char *  name 
)

Definition at line 3419 of file customdata.cc.

References CustomData_get_named_layer_index(), data, and type.

Referenced by bake_targets_output_vertex_colors().

◆ CustomData_get_render_layer()

int CustomData_get_render_layer ( const struct CustomData data,
int  type 
)

◆ CustomData_get_render_layer_index()

int CustomData_get_render_layer_index ( const struct CustomData data,
int  type 
)

◆ CustomData_get_stencil_layer()

int CustomData_get_stencil_layer ( const struct CustomData data,
int  type 
)

◆ CustomData_get_stencil_layer_index()

int CustomData_get_stencil_layer_index ( const struct CustomData data,
int  type 
)

◆ CustomData_has_interp()

bool CustomData_has_interp ( const struct CustomData data)

◆ CustomData_has_layer()

bool CustomData_has_layer ( const struct CustomData data,
int  type 
)

Returns true if a layer with the specified type exists.

Referenced by arrayModifier_doArray(), BKE_editmesh_lnorspace_update(), BKE_mesh_clear_facemap_customdata(), BKE_mesh_ensure_facemap_customdata(), BKE_mesh_ensure_skin_customdata(), BKE_mesh_has_custom_loop_normals(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_nomain_to_mesh(), BKE_mesh_orco_ensure(), BKE_mesh_remesh_reproject_paint_mask(), BKE_remesh_reproject_sculpt_face_sets(), BKE_sculpt_color_layer_create_if_needed(), BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_mask_layers_ensure(), BKE_subdiv_displacement_attach_from_multires(), BKE_subsurf_modifier_use_custom_loop_normals(), bm_corners_to_loops_ex(), BM_custom_loop_normals_from_vector_layer(), BM_custom_loop_normals_to_vector_layer(), BM_lnorspacearr_store(), BM_loop_normal_editdata_array_init(), BM_mesh_bm_from_me(), BM_mesh_cd_flag_apply(), BM_mesh_cd_flag_from_bmesh(), bmesh_edit_begin(), bmesh_edit_end(), bmo_extrude_edge_only_exec(), bmo_extrude_face_region_exec(), bmo_extrude_vert_indiv_exec(), bpy_bmesh_dealloc(), bpy_bmlayercollection_new(), cdDM_from_mesh_ex(), contarget_get_mesh_mat(), copy_ccg_data(), GeometryExporter::create_normals(), createTransMeshSkin(), CustomData_bmesh_do_versions_update_active_layers(), displaceModifier_do(), DM_DupPolys(), draw_subdiv_create_requested_buffers(), draw_subdiv_invalidate_evaluator_for_orco(), dynamicPaint_createUVSurface(), ED_mesh_sculpt_color_add(), ED_mesh_sculpt_color_ensure(), ED_mesh_uv_loop_reset_ex(), ED_uvedit_ensure_uvs(), edbm_flip_normals_custom_loop_normals(), EDBM_uv_check(), EDBM_vert_color_check(), edgetag_ensure_cd_flag(), editbmesh_calc_modifier_final_normals(), editbmesh_calc_modifiers(), ensure_corner_normal_layer(), ensure_orig_index_layer(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), GeometryExporter::export_key_mesh(), face_map_assign_exec(), face_map_remove_from_exec(), flip_custom_normals_init_data(), fmap_select(), blender::io::alembic::get_loop_normals(), get_mesh_evaluator_settings(), give_parvert(), GPU_pbvh_attribute_names_update(), blender::io::obj::obj_importer_test::import_and_check(), Freestyle::BlenderFileLoader::insertShapeNode(), math_layer_info_init(), mesh_add_edges(), mesh_add_loops(), mesh_add_polys(), mesh_add_verts(), mesh_calc_modifier_final_normals(), mesh_calc_modifiers(), mesh_customdata_clear_exec__internal(), mesh_customdata_mask_clear_poll(), mesh_customdata_skin_state(), mesh_has_modifier_final_normals(), mesh_loops_to_tessdata(), MOD_get_texture_coords(), modifyGeometry(), modifyMesh(), multires_ccg_settings_init(), multires_create_grids_in_unsubdivided_base_mesh(), multires_customdata_delete(), multires_modifier_update_mdisps(), multires_subdivide_create_tangent_displacement_linear_grids(), multiresModifier_disp_run(), multiresModifier_subdivide_to_level(), object_fmap_remap_object_mode(), object_fmap_remove_object_mode(), GeometryExporter::operator()(), paint_sample_color(), particle_batch_cache_ensure_pos_and_seg(), particle_batch_cache_ensure_procedural_strand_data(), pointdensity_cache_vertex_color(), proj_paint_state_mesh_eval_init(), blender::io::alembic::read_generated_coordinates(), SCULPT_dynamic_topology_disable_ex(), sculpt_face_sets_ensure(), sculpt_update_object(), select_linked_delimit_validate(), shape_itemf(), shape_propagate(), similar_edge_select_exec(), similar_face_select_exec(), similar_vert_select_exec(), skin_armature_create_exec(), skin_loose_mark_clear_exec(), skin_radii_equalize_exec(), tc_mesh_customdatacorrect_create_impl(), uvedit_unwrap(), uvprojectModifier_do(), vgroup_assign_verts(), workbench_color_type_get(), and blender::io::alembic::write_custom_data().

◆ CustomData_has_math()

bool CustomData_has_math ( const struct CustomData data)

◆ CustomData_has_referenced()

bool CustomData_has_referenced ( const struct CustomData data)

Checks if any of the custom-data layers is referenced.

Referenced by BKE_mesh_nomain_to_mesh().

◆ CustomData_interp()

void CustomData_interp ( const struct CustomData source,
struct CustomData dest,
const int *  src_indices,
const float weights,
const float sub_weights,
int  count,
int  dest_index 
)

Interpolate given custom data source items into a single destination one.

Parameters
src_indicesIndices of every source items to interpolate into the destination one.
weightsThe weight to apply to each source value individually. If NULL, they will be averaged.
sub_weightsThe weights of sub-items, only used to affect each corners of a tessellated face data (should always be and array of four values).
countThe number of source items to interpolate.
dest_indexIndex of the destination item, in which to put the result of the interpolation.

Referenced by add_interp_verts_copy_edges_to_new_mesh(), add_interpolated_polys_to_new_mesh(), BKE_remesh_reproject_vertex_paint(), blender::geometry::customdata_weld(), DM_interp_vert_data(), loop_interpolation_from_corner(), loop_interpolation_init(), set_ccgdm_all_geometry(), subdiv_interpolate_loop_data(), subdiv_mesh_vertex_of_loose_edge_interpolate(), subdiv_vertex_data_interpolate(), vertex_interpolation_from_corner(), and vertex_interpolation_init().

◆ CustomData_is_referenced_layer()

bool CustomData_is_referenced_layer ( struct CustomData data,
int  type 
)

◆ CustomData_layer_has_interp()

bool CustomData_layer_has_interp ( const struct CustomData data,
int  layer_n 
)

◆ CustomData_layer_has_math()

bool CustomData_layer_has_math ( const struct CustomData data,
int  layer_n 
)

◆ CustomData_layer_validate()

bool CustomData_layer_validate ( struct CustomDataLayer layer,
uint  totitems,
bool  do_fixes 
)

Validate and fix data of layer, if possible (needs relevant callback in layer's type to be defined).

Returns
True if some errors were found.

Definition at line 4468 of file customdata.cc.

References BLI_assert, CustomData_layer_ensure_data_exists(), CustomDataLayer::data, layerType_getInfo(), MEM_allocN_len, LayerTypeInfo::size, CustomDataLayer::type, and LayerTypeInfo::validate.

Referenced by mesh_validate_customdata().

◆ CustomData_layers__print()

void CustomData_layers__print ( struct CustomData data)

◆ CustomData_layertype_is_dynamic()

bool CustomData_layertype_is_dynamic ( int  type)

Has dynamically allocated members. This is useful to know if operations such as #memcmp are valid when comparing data from two layers.

Definition at line 4286 of file customdata.cc.

References LayerTypeInfo::free, layerType_getInfo(), and type.

Referenced by um_arraystore_cd_compact().

◆ CustomData_layertype_is_singleton()

bool CustomData_layertype_is_singleton ( int  type)

◆ CustomData_layertype_layers_max()

int CustomData_layertype_layers_max ( int  type)
Returns
Maximum number of layers of given type, -1 means 'no limit'.

Definition at line 4293 of file customdata.cc.

References LayerTypeInfo::defaultname, LayerTypeInfo::layers_max, layerType_getInfo(), and type.

Referenced by CustomData_merge().

◆ CustomData_layertype_name()

const char* CustomData_layertype_name ( int  type)

Get the name of a layer type.

Definition at line 4275 of file customdata.cc.

References layerType_getName(), and type.

Referenced by CustomData_debug_info_from_layers(), and CustomData_layers__print().

◆ customData_mask_layers__print()

void customData_mask_layers__print ( const struct CustomData_MeshMasks mask)

◆ CustomData_merge()

bool CustomData_merge ( const struct CustomData source,
struct CustomData dest,
eCustomDataMask  mask,
eCDAllocType  alloctype,
int  totelem 
)

Same as the above, except that this will preserve existing layers, and only add the layers that were not there yet.

Referenced by BKE_mesh_from_pointcloud(), BKE_pointcloud_from_mesh(), BM_mesh_bm_to_me_for_eval(), BM_mesh_copy_init_customdata_from_mesh_array(), cdDM_from_mesh_ex(), and join_mesh_single().

◆ CustomData_MeshMasks_are_matching()

bool CustomData_MeshMasks_are_matching ( const CustomData_MeshMasks mask_ref,
const CustomData_MeshMasks mask_required 
)

◆ CustomData_MeshMasks_update()

void CustomData_MeshMasks_update ( CustomData_MeshMasks mask_dst,
const CustomData_MeshMasks mask_src 
)

◆ CustomData_number_of_layers()

int CustomData_number_of_layers ( const struct CustomData data,
int  type 
)

Returns the number of layers with this type.

Referenced by InstanceWriter::add_material_bindings(), arrayModifier_doArray(), bc_get_active_uvlayer_name(), bc_get_uvlayer_name(), bev_merge_edge_uvs(), bev_merge_uvs(), BKE_editmesh_loop_tangent_calc(), BKE_mesh_calc_loop_tangent_ex(), BKE_mesh_calc_loop_tangent_step_0(), BKE_mesh_merge_customdata_for_apply_modifier(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_validate_all_customdata(), BKE_subdiv_eval_refine_from_mesh(), bm_edge_delimit_cdata(), BM_mesh_bm_from_me(), BM_mesh_decimate_dissolve_ex(), bmo_mirror_exec(), bmo_subd_init_shape_info(), bmo_transform_exec(), bpy_bmlayercollection_items(), bpy_bmlayercollection_keys(), bpy_bmlayercollection_length(), bpy_bmlayercollection_new(), bpy_bmlayercollection_values(), convert_mfaces_to_mpolys(), GeometryExporter::create_mesh_primitive_list(), GeometryExporter::createTexcoordsSource(), GeometryExporter::createVertexColorSource(), cutEdges(), data_transfer_layersmapping_cdlayers(), data_transfer_layersmapping_cdlayers_multisrc_to_dst(), dt_add_vcol_layers(), dt_layers_select_src_itemf(), ED_mesh_color_add(), ED_mesh_sculpt_color_add(), ED_mesh_uv_add(), ED_mesh_uv_ensure(), ED_paint_proj_mesh_data_check(), edbm_blend_from_shape_exec(), get_num_uv_layers(), getActiveUVLayerName(), mesh_ensure_tessellation_customdata(), mesh_loops_to_tessdata(), mesh_validate_customdata(), modifyMesh(), particle_batch_cache_ensure_pos_and_seg(), particle_batch_cache_ensure_procedural_strand_data(), set_ccgdm_all_geometry(), shape_propagate(), shapekey_layers_to_keyblocks(), skin_smooth_hulls(), subdiv_mesh_ctx_cache_uv_layers(), and blender::io::alembic::write_custom_data().

◆ CustomData_number_of_layers_typemask()

int CustomData_number_of_layers_typemask ( const struct CustomData data,
eCustomDataMask  mask 
)

◆ CustomData_realloc()

void CustomData_realloc ( struct CustomData data,
int  totelem 
)

Reallocate custom data to a new element count. Only affects on data layers which are owned by the CustomData itself, referenced data is kept unchanged,

Note
Take care of referenced layers by yourself!

Definition at line 2307 of file customdata.cc.

References BLI_assert, CD_FLAG_NOFREE, data, CustomDataLayer::data, CustomDataLayer::flag, layerType_getInfo(), MEM_recallocN, LayerTypeInfo::size, and CustomDataLayer::type.

Referenced by BKE_mesh_split_faces(), BKE_pointcloud_from_mesh(), BKE_pointcloud_new_nomain(), blender::nodes::node_geo_extrude_mesh_cc::expand_mesh(), pointcloud_random(), blender::bke::CustomDataAttributes::reallocate(), and blender::bke::CurvesGeometry::resize().

◆ CustomData_reset()

void CustomData_reset ( struct CustomData data)

◆ CustomData_set()

void CustomData_set ( const struct CustomData data,
int  index,
int  type,
const void source 
)

Copies the data from source to the data element at index in the first layer of type no effect if there is no layer of type.

◆ CustomData_set_layer()

void* CustomData_set_layer ( const struct CustomData data,
int  type,
void ptr 
)

Set the pointer of to the first layer of type. the old data is not freed. returns the value of ptr if the layer is found, NULL otherwise.

Referenced by BKE_mesh_nomain_to_mesh().

◆ CustomData_set_layer_active()

void CustomData_set_layer_active ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_active_index()

void CustomData_set_layer_active_index ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_clone()

void CustomData_set_layer_clone ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_clone_index()

void CustomData_set_layer_clone_index ( struct CustomData data,
int  type,
int  n 
)

Definition at line 2602 of file customdata.cc.

References BLI_assert, customdata_typemap_is_valid(), data, and type.

◆ CustomData_set_layer_flag()

void CustomData_set_layer_flag ( struct CustomData data,
int  type,
int  flag 
)

◆ CustomData_set_layer_n()

void* CustomData_set_layer_n ( const struct CustomData data,
int  type,
int  n,
void ptr 
)

◆ CustomData_set_layer_name()

bool CustomData_set_layer_name ( const struct CustomData data,
int  type,
int  n,
const char *  name 
)

Referenced by blo_do_versions_270().

◆ CustomData_set_layer_render()

void CustomData_set_layer_render ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_render_index()

void CustomData_set_layer_render_index ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_stencil()

void CustomData_set_layer_stencil ( struct CustomData data,
int  type,
int  n 
)

◆ CustomData_set_layer_stencil_index()

void CustomData_set_layer_stencil_index ( struct CustomData data,
int  type,
int  n 
)

Definition at line 2614 of file customdata.cc.

References BLI_assert, customdata_typemap_is_valid(), data, and type.

◆ CustomData_set_layer_unique_name()

void CustomData_set_layer_unique_name ( struct CustomData data,
int  index 
)

◆ CustomData_set_only_copy()

void CustomData_set_only_copy ( const struct CustomData data,
eCustomDataMask  mask 
)

Set the CD_FLAG_NOCOPY flag in custom data layers where the mask is zero for the layer type, so only layer types specified by the mask will be copied

Referenced by DM_set_only_copy(), mesh_set_only_copy(), and multiresbake_create_hiresdm().

◆ CustomData_sizeof()

int CustomData_sizeof ( int  type)

◆ CustomData_swap()

void CustomData_swap ( struct CustomData data,
int  index_a,
int  index_b 
)

Swap two items of given custom data, in all available layers.

Definition at line 3319 of file customdata.cc.

References data, layerType_getInfo(), MEM_freeN, MEM_mallocN, POINTER_OFFSET, size(), and LayerTypeInfo::size.

Referenced by BKE_mesh_polygon_flip_ex().

◆ CustomData_swap_corners()

void CustomData_swap_corners ( struct CustomData data,
int  index,
const int *  corner_indices 
)

Swap data inside each item, for all layers. This only applies to item types that may store several sub-item data (e.g. corner data [UVs, VCol, ...] of tessellated faces).

Parameters
corner_indicesA mapping 'new_index -> old_index' of sub-item data.

Definition at line 3306 of file customdata.cc.

References data, layerType_getInfo(), offset, POINTER_OFFSET, LayerTypeInfo::size, and LayerTypeInfo::swap.

Referenced by BKE_mesh_mface_index_validate().

◆ CustomData_to_bmesh_block()

void CustomData_to_bmesh_block ( const struct CustomData source,
struct CustomData dest,
int  src_index,
void **  dest_block,
bool  use_default_init 
)

Copy custom data to/from layers as in mesh/derived-mesh, to edit-mesh blocks of data. the CustomData's must not be compatible.

Parameters
use_default_initinitializes data which can't be copied, typically you'll want to use this if the BM_xxx create function is called with BM_CREATE_SKIP_CD flag

Referenced by BM_mesh_bm_from_me().

◆ CustomData_update_typemap()

void CustomData_update_typemap ( struct CustomData data)

◆ CustomData_validate_layer_name()

void CustomData_validate_layer_name ( const struct CustomData data,
int  type,
const char *  name,
char *  outname 
)

◆ CustomData_verify_versions()

bool CustomData_verify_versions ( struct CustomData data,
int  index 
)

For file reading compatibility, returns false if the layer was freed, only after this test passes, layer->data should be assigned.

Definition at line 4388 of file customdata.cc.

References CD_CREASE, CD_FACEMAP, CD_NUMTYPES, CD_PAINT_MASK, CD_SCULPT_FACE_SETS, CLOG_WARN, data, LayerTypeInfo::defaultname, ELEM, layerType_getInfo(), LOG, LayerTypeInfo::structnum, and CustomDataLayer::type.

Referenced by CustomData_blend_read().

Variable Documentation

◆ CD_MASK_BAREMESH

const CustomData_MeshMasks CD_MASK_BAREMESH
extern

◆ CD_MASK_BAREMESH_ORIGINDEX

const CustomData_MeshMasks CD_MASK_BAREMESH_ORIGINDEX
extern

◆ CD_MASK_BMESH

const CustomData_MeshMasks CD_MASK_BMESH
extern

◆ CD_MASK_DERIVEDMESH

const CustomData_MeshMasks CD_MASK_DERIVEDMESH
extern

◆ CD_MASK_EVERYTHING

const CustomData_MeshMasks CD_MASK_EVERYTHING
extern

◆ CD_MASK_MESH

const CustomData_MeshMasks CD_MASK_MESH
extern