Blender V5.3
BKE_customdata.hh File Reference

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

#include <optional>
#include "BLI_generic_virtual_array.hh"
#include "BLI_implicit_sharing.hh"
#include "BLI_memory_counter_fwd.hh"
#include "BLI_span.hh"
#include "BLI_string_ref.hh"
#include "BLI_sys_types.hh"
#include "BLI_vector.hh"
#include "BKE_volume_enums.hh"
#include "DNA_customdata_types.h"

Go to the source code of this file.

Classes

struct  blender::BMUVOffsets
struct  blender::CDBlockBytes
struct  blender::BMCustomDataCopyMap
struct  blender::BMCustomDataCopyMap::TrivialCopy
struct  blender::BMCustomDataCopyMap::Copy
struct  blender::BMCustomDataCopyMap::TrivialDefault
struct  blender::BMCustomDataCopyMap::Default
struct  blender::BMCustomDataCopyMap::Free
struct  blender::CustomDataTransferLayerMap

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke

Macros

#define UV_PINNED_NAME   "pn"
#define BMUVOFFSETS_NONE   {-1, -1}
#define ORIGINDEX_NONE   -1

Typedefs

using blender::cd_interp = void (*)(const void **sources, const float *weights, int count, void *dest)
using blender::cd_copy = void (*)(const void *source, void *dest, int count)
using blender::cd_set_default_value = void (*)(void *data, int count)
using blender::cd_free = void (*)(void *data, int count)
using blender::cd_validate = bool (*)(void *item, uint totitems, bool do_fixes)
using blender::cd_datatransfer_interp

Enumerations

enum  blender::eCDAllocType { blender::CD_SET_DEFAULT = 2 , blender::CD_CONSTRUCT = 5 }
enum  { blender::ME_VERT = 1 << 0 , blender::ME_EDGE = 1 << 1 , blender::ME_POLY = 1 << 2 , blender::ME_LOOP = 1 << 3 }

Functions

eCustomDataMask blender::CD_TYPE_AS_MASK (eCustomDataType type)
size_t blender::CustomData_get_elem_size (const CustomDataLayer *layer)
void blender::CustomData_count_memory (const CustomData &data, int totelem, MemoryCounter &memory)
Mesh Mask Utilities
void blender::CustomData_MeshMasks_update (CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
bool blender::CustomData_MeshMasks_are_matching (const CustomData_MeshMasks *mask_ref, const CustomData_MeshMasks *mask_required)
CustomData Functions
bool blender::CustomData_layer_has_math (const CustomData *data, int layer_n)
bool blender::CustomData_layer_has_interp (const CustomData *data, int layer_n)
bool blender::CustomData_has_math (const CustomData *data)
bool blender::CustomData_has_interp (const CustomData *data)
bool blender::CustomData_bmesh_has_free (const CustomData *data)
void blender::CustomData_data_copy_value (eCustomDataType type, const void *source, void *dest)
void blender::CustomData_data_set_default_value (eCustomDataType type, void *elem)
void blender::CustomData_data_mix_value (eCustomDataType type, const void *source, void *dest, int mixmode, float mixfactor)
bool blender::CustomData_data_equals (eCustomDataType type, const void *data1, const void *data2)
void blender::CustomData_data_initminmax (eCustomDataType type, void *min, void *max)
void blender::CustomData_data_dominmax (eCustomDataType type, const void *data, void *min, void *max)
void blender::CustomData_data_multiply (eCustomDataType type, void *data, float fac)
void blender::CustomData_data_add (eCustomDataType type, void *data1, const void *data2)
void blender::CustomData_init_from (const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
void blender::CustomData_init_layout_from (const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
void blender::CustomData_update_typemap (CustomData *data)
bool blender::CustomData_merge (const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
bool blender::CustomData_merge_layout (const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
void blender::CustomData_realloc (CustomData *data, int old_size, int new_size, eCDAllocType alloctype=CD_CONSTRUCT)
bool blender::CustomData_bmesh_merge_layout (const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, BMesh *bm, char htype)
void blender::CustomData_reset (CustomData *data)
void blender::CustomData_free (CustomData *data)
void * blender::CustomData_add_layer (CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
const ImplicitSharingInfo * blender::CustomData_make_layer_sharing_info (eCustomDataType type, const void *data, int totelem)
const void * blender::CustomData_add_layer_with_data (CustomData *data, eCustomDataType type, void *layer_data, int totelem, const ImplicitSharingInfo *sharing_info)
void * blender::CustomData_add_layer_named (CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem, StringRef name)
const void * blender::CustomData_add_layer_named_with_data (CustomData *data, eCustomDataType type, void *layer_data, int totelem, StringRef name, const ImplicitSharingInfo *sharing_info)
bool blender::CustomData_free_layer (CustomData *data, eCustomDataType type, int index)
bool blender::CustomData_free_layer_named (CustomData *data, StringRef name)
bool blender::CustomData_free_layer_active (CustomData *data, eCustomDataType type)
bool blender::CustomData_free_layers (CustomData *data, eCustomDataType type)
bool blender::CustomData_has_layer (const CustomData *data, eCustomDataType type)
bool blender::CustomData_has_layer_named (const CustomData *data, eCustomDataType type, StringRef name)
int blender::CustomData_number_of_layers (const CustomData *data, eCustomDataType type)
int blender::CustomData_number_of_anonymous_layers (const CustomData *data, eCustomDataType type)
int blender::CustomData_number_of_layers_typemask (const CustomData *data, eCustomDataMask mask)
void blender::CustomData_set_only_copy (const CustomData *data, eCustomDataMask mask)
void blender::CustomData_copy_data (const CustomData *source, CustomData *dest, int source_index, int dest_index, int count)
void blender::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 blender::CustomData_copy_elements (eCustomDataType type, const void *src_data, void *dst_data, int count)
void blender::CustomData_bmesh_copy_block (CustomData &data, void *src_block, void **dst_block)
BMCustomDataCopyMap blender::CustomData_bmesh_copy_map_calc (const CustomData &src, const CustomData &dst, eCustomDataMask mask_exclude=0)
void blender::CustomData_bmesh_copy_block (CustomData &dst_data, const BMCustomDataCopyMap &map, const void *src_block, void **dst_block)
void blender::CustomData_copy_layer_type_data (const CustomData *source, CustomData *destination, eCustomDataType type, int source_index, int destination_index, int count)
void blender::CustomData_free_elem (CustomData *data, int index, int count)
void blender::CustomData_interp (const CustomData *source, CustomData *dest, const int *src_indices, const float *weights, int count, int dest_index)
void blender::CustomData_bmesh_interp_n (CustomData *data, const void **src_blocks, const float *weights, int count, void *dst_block_ofs, int n)
void blender::CustomData_bmesh_interp (CustomData *data, const void **src_blocks, const float *weights, int count, void *dst_block)
void blender::CustomData_swap_corners (CustomData *data, int index, const int *corner_indices)
void blender::CustomData_ensure_data_is_mutable (CustomDataLayer *layer, int totelem)
void blender::CustomData_ensure_layers_are_mutable (CustomData *data, int totelem)
void * blender::CustomData_get_for_write (CustomData *data, int index, eCustomDataType type, int totelem)
void * blender::CustomData_get_n_for_write (CustomData *data, eCustomDataType type, int index, int n, int totelem)
void * blender::CustomData_bmesh_get (const CustomData *data, void *block, eCustomDataType type)
void * blender::CustomData_bmesh_get_n (const CustomData *data, void *block, eCustomDataType type, int n)
void * blender::CustomData_bmesh_get_layer_n (const CustomData *data, void *block, int n)
bool blender::CustomData_set_layer_name (CustomData *data, eCustomDataType type, int n, StringRef name)
const char * blender::CustomData_get_layer_name (const CustomData *data, eCustomDataType type, int n)
const void * blender::CustomData_get_layer (const CustomData *data, eCustomDataType type)
void * blender::CustomData_get_layer_for_write (CustomData *data, eCustomDataType type, int totelem)
const void * blender::CustomData_get_layer_n (const CustomData *data, eCustomDataType type, int n)
void * blender::CustomData_get_layer_n_for_write (CustomData *data, eCustomDataType type, int n, int totelem)
const void * blender::CustomData_get_layer_named (const CustomData *data, eCustomDataType type, StringRef name)
void * blender::CustomData_get_layer_named_for_write (CustomData *data, eCustomDataType type, StringRef name, int totelem)
int blender::CustomData_get_offset (const CustomData *data, eCustomDataType type)
int blender::CustomData_get_offset_named (const CustomData *data, eCustomDataType type, StringRef name)
int blender::CustomData_get_n_offset (const CustomData *data, eCustomDataType type, int n)
int blender::CustomData_get_layer_index (const CustomData *data, eCustomDataType type)
int blender::CustomData_get_layer_index_n (const CustomData *data, eCustomDataType type, int n)
int blender::CustomData_get_named_layer_index (const CustomData *data, eCustomDataType type, StringRef name)
int blender::CustomData_get_named_layer_index_notype (const CustomData *data, StringRef name)
int blender::CustomData_get_active_layer_index (const CustomData *data, eCustomDataType type)
int blender::CustomData_get_render_layer_index (const CustomData *data, eCustomDataType type)
int blender::CustomData_get_named_layer (const CustomData *data, eCustomDataType type, StringRef name)
int blender::CustomData_get_active_layer (const CustomData *data, eCustomDataType type)
int blender::CustomData_get_render_layer (const CustomData *data, eCustomDataType type)
const char * blender::CustomData_get_active_layer_name (const CustomData *data, eCustomDataType type)
const char * blender::CustomData_get_render_layer_name (const CustomData *data, eCustomDataType type)
void blender::CustomData_bmesh_set_n (CustomData *data, void *block, eCustomDataType type, int n, const void *source)
void blender::CustomData_set_layer_active (CustomData *data, eCustomDataType type, int n)
void blender::CustomData_set_layer_render (CustomData *data, eCustomDataType type, int n)
void blender::CustomData_set_layer_active_index (CustomData *data, eCustomDataType type, int n)
void blender::CustomData_set_layer_render_index (CustomData *data, eCustomDataType type, int n)
void blender::CustomData_set_layer_flag (CustomData *data, eCustomDataType type, eCustomDataLayer_Flag flag)
void blender::CustomData_bmesh_set_default (CustomData *data, void **block)
void blender::CustomData_bmesh_free_block (CustomData *data, void **block)
void blender::CustomData_bmesh_alloc_block (CustomData *data, void **block)
void blender::CustomData_bmesh_free_block_data (CustomData *data, void *block)
int blender::CustomData_sizeof (eCustomDataType type)
const char * blender::CustomData_layertype_name (eCustomDataType type)
bool blender::CustomData_layertype_is_singleton (eCustomDataType type)
bool blender::CustomData_layertype_is_dynamic (eCustomDataType type)
int blender::CustomData_layertype_layers_max (eCustomDataType type)
int blender::CustomData_name_maxncpy_calc (StringRef name)
void blender::CustomData_set_layer_unique_name (CustomData *data, int index)
bool blender::CustomData_verify_versions (CustomData *data, int index)
void blender::CustomData_bmesh_init_pool (CustomData *data, int totelem, char htype)
External Files
void blender::CustomData_external_add (CustomData *data, ID *id, eCustomDataType type, int totelem, const char *filepath)
void blender::CustomData_external_remove (CustomData *data, ID *id, eCustomDataType type, int totelem)
bool blender::CustomData_external_test (CustomData *data, eCustomDataType type)
void blender::CustomData_external_write (CustomData *data, StringRefNull basepath, ID *id, eCustomDataMask mask, int totelem, int free)
void blender::CustomData_external_read (CustomData *data, StringRefNull basepath, ID *id, eCustomDataMask mask, int totelem)
void blender::CustomData_external_reload (CustomData *data, ID *id, eCustomDataMask mask, int totelem)
Mesh-to-Mesh Data Transfer
void blender::CustomData_data_transfer (const MeshPairRemap *me_remap, CustomDataTransferLayerMap *laymap)
Custom Data IO
void blender::CustomData_blend_write_prepare (CustomData &data, Vector< CustomDataLayer, 16 > &layers_to_write)
void blender::CustomData_blend_write (BlendWriter *writer, CustomData *data, Span< CustomDataLayer > layers_to_write, int count, eCustomDataMask cddata_mask, ID *id)
void blender::CustomData_blend_read (BlendDataReader *reader, CustomData *data, int count)
Custom Data Debugging
void blender::CustomData_debug_info_from_layers (const CustomData *data, const char *indent, DynStr *dynstr)
Custom Data C++ API
std::optional< VolumeGridType > blender::bke::custom_data_type_to_volume_grid_type (eCustomDataType type)
std::optional< eCustomDataType > blender::bke::volume_grid_type_to_custom_data_type (VolumeGridType type)

Layer Type Information (#LAYERTYPEINFO)

const CustomData_MeshMasks blender::CD_MASK_BAREMESH
const CustomData_MeshMasks blender::CD_MASK_BAREMESH_ORIGINDEX
const CustomData_MeshMasks blender::CD_MASK_MESH
const CustomData_MeshMasks blender::CD_MASK_DERIVEDMESH
const CustomData_MeshMasks blender::CD_MASK_BMESH
const CustomData_MeshMasks blender::CD_MASK_EVERYTHING
void blender::customData_mask_layers__print (const CustomData_MeshMasks *mask)

Detailed Description

CustomData interface, see also DNA_customdata_types.h.

Definition in file BKE_customdata.hh.

Macro Definition Documentation

◆ BMUVOFFSETS_NONE

◆ ORIGINDEX_NONE

#define ORIGINDEX_NONE   -1

For ORIGINDEX layer type, indicates no original index for this element.

Definition at line 77 of file BKE_customdata.hh.

Referenced by blender::ed::object::bake_targets_populate_pixels_color_attributes(), blender::BKE_mesh_calc_edges_tessface(), blender::BKE_mesh_foreach_mapped_edge(), blender::BKE_mesh_foreach_mapped_face_center(), blender::BKE_mesh_foreach_mapped_loop(), blender::BKE_mesh_foreach_mapped_subdiv_face_center(), blender::BKE_mesh_foreach_mapped_vert(), blender::BKE_mesh_origindex_map_create(), blender::BKE_object_as_kdtree(), blender::draw::bm_original_edge_get(), blender::draw::bm_original_face_get(), blender::draw::bm_original_vert_get(), blender::bm_to_mesh_shape(), blender::bm_to_mesh_vertex_map(), blender::BM_vert_create(), blender::draw::calc_mesh_edge_visibility(), blender::draw::calc_vert_visibility_mapped_mesh(), blender::draw::calc_vert_visibility_mesh(), blender::draw::calc_visible_loose_edge_indices(), blender::construct_param_handle_subsurfed(), blender::ED_mesh_pick_edge(), blender::ED_mesh_pick_face_vert(), blender::draw::extract_edituv_lines_mesh(), blender::draw::extract_edituv_points_mesh(), blender::draw::extract_lines_loose_geom_subdiv(), blender::draw::extract_lines_paint_mask_subdiv(), blender::draw::extract_points_subdiv_mesh(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), blender::ed::object::find_original_loop(), blender::layerDefault_origindex(), blender::mesh_merge_transform(), blender::MOD_solidify_extrude_modifyMesh(), blender::MOD_solidify_nonmanifold_modifyMesh(), blender::modify_mesh(), blender::paintface_flush_flags(), blender::paintvert_flush_flags(), blender::project_paint_check_face_paintable(), blender::psys_calc_dmcache(), blender::skin_set_orig_indices(), blender::bke::subdiv::subdiv_copy_edge_data(), blender::bke::subdiv::subdiv_foreach_edges_all_patches_regular(), blender::bke::subdiv::subdiv_foreach_edges_all_patches_special(), blender::bke::subdiv::subdiv_foreach_edges_column(), blender::bke::subdiv::subdiv_foreach_loops_of_face(), blender::bke::subdiv::subdiv_mesh_vert_corner(), blender::bke::subdiv::subdiv_mesh_vert_of_loose_edge_interpolate(), blender::bke::subdiv::subdiv_vert_data_interpolate(), and blender::texface_from_original_index().

◆ UV_PINNED_NAME

#define UV_PINNED_NAME   "pn"

These names are used as prefixes for UV layer names to find the associated boolean layers. They should never be longer than 2 chars, as MAX_CUSTOMDATA_LAYER_NAME has 4 extra bytes above what can be used for the base layer name, and these prefixes are placed between 2 '.'s at the start of the layer name. For example The uv vert selection layer of a layer named UVMap.001 will be called .pn.UVMap.001.

Definition at line 49 of file BKE_customdata.hh.

Referenced by blender::bke::allow_procedural_attribute_access(), blender::BKE_uv_map_pin_name_get(), and blender::CustomData_name_maxncpy_calc().