Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_customdata.h
| Show All 30 Lines | |||||
| #include "BLI_sys_types.h" | #include "BLI_sys_types.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_customdata_types.h" | #include "DNA_customdata_types.h" | ||||
| struct BMesh; | struct BMesh; | ||||
| struct CustomData; | struct CustomData; | ||||
| struct CustomData_MeshMasks; | |||||
| struct ID; | struct ID; | ||||
| typedef uint64_t CustomDataMask; | typedef uint64_t CustomDataMask; | ||||
| /*a data type large enough to hold 1 element from any customdata layer type*/ | /*a data type large enough to hold 1 element from any customdata layer type*/ | ||||
| typedef struct {unsigned char data[64]; } CDBlockBytes; | typedef struct {unsigned char data[64]; } CDBlockBytes; | ||||
| extern const CustomDataMask CD_MASK_BAREMESH; | extern const CustomData_MeshMasks CD_MASK_BAREMESH; | ||||
| extern const CustomDataMask CD_MASK_MESH; | extern const CustomData_MeshMasks CD_MASK_BAREMESH_ORIGINDEX; | ||||
| extern const CustomDataMask CD_MASK_EDITMESH; | extern const CustomData_MeshMasks CD_MASK_MESH; | ||||
| extern const CustomDataMask CD_MASK_DERIVEDMESH; | extern const CustomData_MeshMasks CD_MASK_EDITMESH; | ||||
| extern const CustomDataMask CD_MASK_BMESH; | extern const CustomData_MeshMasks CD_MASK_DERIVEDMESH; | ||||
| extern const CustomDataMask CD_MASK_FACECORNERS; | extern const CustomData_MeshMasks CD_MASK_BMESH; | ||||
| extern const CustomDataMask CD_MASK_EVERYTHING; | extern const CustomData_MeshMasks CD_MASK_FACECORNERS; | ||||
| extern const CustomData_MeshMasks CD_MASK_EVERYTHING; | |||||
| /* for ORIGINDEX layer type, indicates no original index for this element */ | /* for ORIGINDEX layer type, indicates no original index for this element */ | ||||
| #define ORIGINDEX_NONE -1 | #define ORIGINDEX_NONE -1 | ||||
| /* initializes a CustomData object with the same layer setup as source and | /* initializes a CustomData object with the same layer setup as source and | ||||
| * memory space for totelem elements. mask must be an array of length | * memory space for totelem elements. mask must be an array of length | ||||
| * CD_NUMTYPES elements, that indicate if a layer can be copied. */ | * CD_NUMTYPES elements, that indicate if a layer can be copied. */ | ||||
| /* add/copy/merge allocation types */ | /* add/copy/merge allocation types */ | ||||
| typedef enum eCDAllocType { | typedef enum eCDAllocType { | ||||
| CD_ASSIGN = 0, /* use the data pointer */ | CD_ASSIGN = 0, /* use the data pointer */ | ||||
| CD_CALLOC = 1, /* allocate blank memory */ | CD_CALLOC = 1, /* allocate blank memory */ | ||||
| CD_DEFAULT = 2, /* allocate and set to default */ | CD_DEFAULT = 2, /* allocate and set to default */ | ||||
| CD_REFERENCE = 3, /* use data pointers, set layer flag NOFREE */ | CD_REFERENCE = 3, /* use data pointers, set layer flag NOFREE */ | ||||
| CD_DUPLICATE = 4, /* do a full copy of all layers, only allowed if source | CD_DUPLICATE = 4, /* do a full copy of all layers, only allowed if source | ||||
| * has same number of elements */ | * has same number of elements */ | ||||
| } eCDAllocType; | } eCDAllocType; | ||||
| #define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) | #define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) | ||||
| void customData_mask_layers__print(CustomDataMask mask); | void customData_mask_layers__print(const struct CustomData_MeshMasks *mask); | ||||
| typedef void (*cd_interp)(const void **sources, const float *weights, const float *sub_weights, int count, void *dest); | 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 void (*cd_copy)(const void *source, void *dest, int count); | ||||
| typedef bool (*cd_validate)(void *item, const uint totitems, const bool do_fixes); | typedef bool (*cd_validate)(void *item, const uint totitems, const bool do_fixes); | ||||
| 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); | |||||
| /** | /** | ||||
| * Checks if the layer at physical offset \a layer_n (in data->layers) support math | * Checks if the layer at physical offset \a layer_n (in data->layers) support math | ||||
| * the below operations. | * the below operations. | ||||
| */ | */ | ||||
| bool CustomData_layer_has_math(const struct CustomData *data, int layer_n); | 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_layer_has_interp(const struct CustomData *data, int layer_n); | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines | |||||