Blender
V3.3
|
Generic geometry attributes built on CustomData. More...
Go to the source code of this file.
Macros | |
#define | ATTR_DOMAIN_NUM 6 |
#define | ATTR_DOMAIN_AS_MASK(domain) ((eAttrDomainMask)((1 << (int)(domain)))) |
#define | ATTR_DOMAIN_MASK_COLOR ((eAttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) |
Typedefs | |
typedef enum eAttrDomain | eAttrDomain |
typedef enum eAttrDomainMask | eAttrDomainMask |
Enumerations | |
enum | eAttrDomain { ATTR_DOMAIN_AUTO = -1 , ATTR_DOMAIN_POINT = 0 , ATTR_DOMAIN_EDGE = 1 , ATTR_DOMAIN_FACE = 2 , ATTR_DOMAIN_CORNER = 3 , ATTR_DOMAIN_CURVE = 4 , ATTR_DOMAIN_INSTANCE = 5 } |
enum | eAttrDomainMask { ATTR_DOMAIN_MASK_POINT = (1 << 0) , ATTR_DOMAIN_MASK_EDGE = (1 << 1) , ATTR_DOMAIN_MASK_FACE = (1 << 2) , ATTR_DOMAIN_MASK_CORNER = (1 << 3) , ATTR_DOMAIN_MASK_CURVE = (1 << 4) , ATTR_DOMAIN_MASK_ALL = (1 << 5) - 1 } |
Generic geometry attributes built on CustomData.
Definition in file BKE_attribute.h.
#define ATTR_DOMAIN_AS_MASK | ( | domain | ) | ((eAttrDomainMask)((1 << (int)(domain)))) |
Definition at line 45 of file BKE_attribute.h.
#define ATTR_DOMAIN_MASK_COLOR ((eAttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) |
Definition at line 48 of file BKE_attribute.h.
#define ATTR_DOMAIN_NUM 6 |
Definition at line 34 of file BKE_attribute.h.
typedef enum eAttrDomain eAttrDomain |
#Attribute.domain
typedef enum eAttrDomainMask eAttrDomainMask |
enum eAttrDomain |
#Attribute.domain
Enumerator | |
---|---|
ATTR_DOMAIN_AUTO | |
ATTR_DOMAIN_POINT | |
ATTR_DOMAIN_EDGE | |
ATTR_DOMAIN_FACE | |
ATTR_DOMAIN_CORNER | |
ATTR_DOMAIN_CURVE | |
ATTR_DOMAIN_INSTANCE |
Definition at line 25 of file BKE_attribute.h.
enum eAttrDomainMask |
Enumerator | |
---|---|
ATTR_DOMAIN_MASK_POINT | |
ATTR_DOMAIN_MASK_EDGE | |
ATTR_DOMAIN_MASK_FACE | |
ATTR_DOMAIN_MASK_CORNER | |
ATTR_DOMAIN_MASK_CURVE | |
ATTR_DOMAIN_MASK_ALL |
Definition at line 36 of file BKE_attribute.h.
bool BKE_attribute_allow_procedural_access | ( | const char * | attribute_name | ) |
Definition at line 138 of file attribute.cc.
References blender::bke::allow_procedural_attribute_access().
Referenced by BKE_id_attributes_active_get().
Definition at line 203 of file attribute.cc.
References BLI_strncpy(), BLI_strncpy_utf8(), BLI_uniquename_cb(), data, IFACE_, MAX_CUSTOMDATA_LAYER_NAME, and unique_name_cb().
Referenced by BKE_id_attribute_duplicate(), BKE_id_attribute_new(), and BKE_id_attribute_rename().
void BKE_id_attribute_copy_domains_temp | ( | short | id_type, |
const struct CustomData * | vdata, | ||
const struct CustomData * | edata, | ||
const struct CustomData * | ldata, | ||
const struct CustomData * | pdata, | ||
const struct CustomData * | cdata, | ||
struct ID * | r_id | ||
) |
Sets up a temporary ID with arbitrary CustomData domains. r_id
will be zero initialized with ID type id_type and any non-nullptr CustomData parameter will be copied into the appropriate struct members.
r_id | Pointer to storage sufficient for ID type-code id_type. |
Referenced by bmo_get_loop_color_ref(), GPU_pbvh_attribute_names_update(), GPU_pbvh_mesh_buffers_update(), mesh_cd_calc_used_gpu_layers(), request_active_and_default_color_attributes(), and retrieve_active_attribute_names().
int BKE_id_attribute_data_length | ( | struct ID * | id, |
struct CustomDataLayer * | layer | ||
) |
Definition at line 413 of file attribute.cc.
References ARRAY_HAS_ITEM, ATTR_DOMAIN_NUM, BLI_assert_msg, DomainInfo::customdata, Mesh::edit_mesh, get_domains(), GS, id, ID_ME, CustomData::layers, DomainInfo::length, mesh, ID::name, and CustomData::totlayer.
eAttrDomain BKE_id_attribute_domain | ( | const struct ID * | id, |
const struct CustomDataLayer * | layer | ||
) |
Referenced by bake_targets_output_vertex_colors(), BKE_pbvh_get_color_layer(), BKE_remesh_reproject_vertex_paint(), bmo_get_loop_color_ref(), edbm_reverse_colors_exec(), edbm_rotate_colors_exec(), get_vcol_elements(), GPU_pbvh_attribute_names_update(), GPU_pbvh_mesh_buffers_update(), paint_object_attributes_active_color_fill_ex(), SCULPT_has_loop_colors(), sculpt_save_active_attribute(), sculpt_undo_set_active_layer(), and vpaint_stroke_test_start().
struct CustomDataLayer* BKE_id_attribute_duplicate | ( | struct ID * | id, |
const char * | name, | ||
struct ReportList * | reports | ||
) |
Creates a duplicate attribute layer.
Definition at line 256 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, BKE_id_attribute_calc_unique_name(), BKE_id_attribute_search(), BKE_report(), BLI_assert_unreachable, CD_MASK_PROP_ALL, blender::bke::cpp_type_to_custom_data_type(), Mesh::edit_mesh, blender::bke::get_attribute_accessor_for_write(), GS, id, ID_ME, MAX_CUSTOMDATA_LAYER_NAME, mesh, ID::name, RPT_ERROR, src, type, and UNUSED_VARS.
Referenced by blender::ed::geometry::geometry_color_attribute_duplicate_exec().
struct CustomDataLayer* BKE_id_attribute_find | ( | const struct ID * | id, |
const char * | name, | ||
int | type, | ||
eAttrDomain | domain | ||
) |
CustomDataLayer* BKE_id_attribute_from_index | ( | struct ID * | id, |
int | lookup_index, | ||
eAttrDomainMask | domain_mask, | ||
eCustomDataMask | layer_mask | ||
) |
Definition at line 551 of file attribute.cc.
References ATTR_DOMAIN_NUM, CD_FLAG_TEMPORARY, CD_TYPE_AS_MASK, DomainInfo::customdata, CustomDataLayer::flag, get_domains(), CustomData::layers, CustomData::totlayer, and CustomDataLayer::type.
Referenced by BKE_remesh_reproject_vertex_paint(), bmo_get_loop_color_ref(), and blender::ed::geometry::next_color_attribute().
struct CustomDataLayer* BKE_id_attribute_new | ( | struct ID * | id, |
const char * | name, | ||
int | type, | ||
eAttrDomain | domain, | ||
struct ReportList * | reports | ||
) |
Create a new attribute layer.
Definition at line 220 of file attribute.cc.
References ATTR_DOMAIN_NUM, BKE_id_attribute_calc_unique_name(), BKE_report(), BM_data_layer_add_named(), DomainInfo::customdata, CustomData_get_named_layer_index(), Mesh::edit_mesh, blender::bke::get_attribute_accessor_for_write(), get_domains(), GS, id, ID_ME, CustomData::layers, MAX_CUSTOMDATA_LAYER_NAME, mesh, ID::name, RPT_ERROR, and type.
Referenced by blender::ed::geometry::geometry_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_add_exec(), proj_paint_color_attribute_create(), and blender::io::alembic::read_velocity().
bool BKE_id_attribute_remove | ( | struct ID * | id, |
const char * | name, | ||
struct ReportList * | reports | ||
) |
Definition at line 288 of file attribute.cc.
References ATTR_DOMAIN_NUM, BKE_id_attribute_required(), BKE_report(), BM_data_layer_free_named(), data, Mesh::edit_mesh, blender::bke::get_attribute_accessor_for_write(), get_domains(), GS, id, ID_ME, mesh, ID::name, and RPT_ERROR.
Referenced by blender::ed::geometry::geometry_attribute_remove_exec(), and blender::ed::geometry::geometry_color_attribute_remove_exec().
bool BKE_id_attribute_rename | ( | struct ID * | id, |
const char * | old_name, | ||
const char * | new_name, | ||
struct ReportList * | reports | ||
) |
Definition at line 143 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, BKE_id_attribute_calc_unique_name(), BKE_id_attribute_required(), BKE_id_attribute_search(), BKE_report(), BLI_assert_msg, BLI_strncpy_utf8(), CD_MASK_PROP_ALL, MAX_CUSTOMDATA_LAYER_NAME, CustomDataLayer::name, RPT_ERROR, and STREQ.
struct CustomDataLayer* BKE_id_attribute_search | ( | struct ID * | id, |
const char * | name, | ||
eCustomDataMask | type, | ||
eAttrDomainMask | domain_mask | ||
) |
Definition at line 348 of file attribute.cc.
References ATTR_DOMAIN_AS_MASK, ATTR_DOMAIN_NUM, ATTR_DOMAIN_POINT, CD_TYPE_AS_MASK, DomainInfo::customdata, get_domains(), CustomData::layers, CustomDataLayer::name, STREQ, CustomData::totlayer, and CustomDataLayer::type.
Referenced by BKE_id_attribute_duplicate(), BKE_id_attribute_rename(), and sculpt_undo_set_active_layer().
struct CustomDataLayer* BKE_id_attribute_subset_active_get | ( | const struct ID * | id, |
int | active_flag, | ||
eAttrDomainMask | domain_mask, | ||
eCustomDataMask | mask | ||
) |
void BKE_id_attribute_subset_active_set | ( | struct ID * | id, |
struct CustomDataLayer * | layer, | ||
int | active_flag, | ||
eAttrDomainMask | domain_mask, | ||
eCustomDataMask | mask | ||
) |
Definition at line 674 of file attribute.cc.
References ATTR_DOMAIN_NUM, CD_FLAG_TEMPORARY, CD_TYPE_AS_MASK, DomainInfo::customdata, CustomDataLayer::flag, get_domains(), get_domains_types(), CustomData::layers, mask(), CustomData::totlayer, and CustomDataLayer::type.
Referenced by BKE_id_attributes_active_color_set(), and BKE_id_attributes_render_color_set().
int BKE_id_attribute_to_index | ( | const struct ID * | id, |
const CustomDataLayer * | layer, | ||
eAttrDomainMask | domain_mask, | ||
eCustomDataMask | layer_mask | ||
) |
Layer is allowed to be nullptr; if so -1 (layer not found) will be returned.
Referenced by edbm_reverse_colors_exec(), edbm_rotate_colors_exec(), and blender::ed::geometry::next_color_attribute().
struct CustomDataLayer* BKE_id_attributes_active_color_get | ( | const struct ID * | id | ) |
Referenced by bake_object_check(), bake_targets_init_vertex_colors(), bake_targets_output_vertex_colors(), BKE_pbvh_get_color_layer(), BKE_remesh_reproject_vertex_paint(), ED_mesh_color_ensure(), edbm_reverse_colors_exec(), edbm_rotate_colors_exec(), face_corner_color_equalize_vertices(), blender::ed::geometry::geometry_color_attribute_duplicate_exec(), blender::ed::geometry::geometry_color_attribute_remove_exec(), blender::ed::geometry::geometry_color_attributes_duplicate_poll(), blender::ed::geometry::geometry_color_attributes_remove_poll(), get_vcol_elements(), GPU_pbvh_attribute_names_update(), GPU_pbvh_mesh_buffers_update(), paint_object_attributes_active_color_fill_ex(), request_active_and_default_color_attributes(), retrieve_active_attribute_names(), SCULPT_has_loop_colors(), sculpt_save_active_attribute(), transform_active_color(), vertex_paint_from_weight(), vertex_paint_mode_poll(), vpaint_do_paint(), vpaint_init_vpaint(), vpaint_stroke_test_start(), and blender::io::obj::OBJWriter::write_vertex_coords().
void BKE_id_attributes_active_color_set | ( | struct ID * | id, |
struct CustomDataLayer * | active_layer | ||
) |
Definition at line 715 of file attribute.cc.
References ATTR_DOMAIN_MASK_COLOR, BKE_id_attribute_subset_active_set(), CD_FLAG_COLOR_ACTIVE, and CD_MASK_COLOR_ALL.
Referenced by BKE_remesh_reproject_vertex_paint(), BKE_sculpt_color_layer_create_if_needed(), blo_do_versions_300(), ED_mesh_color_ensure(), blender::ed::geometry::geometry_color_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_duplicate_exec(), blender::ed::geometry::next_color_attribute(), proj_paint_color_attribute_create(), and sculpt_undo_set_active_layer().
struct CustomDataLayer* BKE_id_attributes_active_get | ( | struct ID * | id | ) |
Definition at line 458 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, ATTR_DOMAIN_NUM, BKE_attribute_allow_procedural_access(), BKE_id_attributes_active_index_p(), BKE_id_attributes_length(), CD_MASK_PROP_ALL, CD_TYPE_AS_MASK, DomainInfo::customdata, get_domains(), CustomData::layers, CustomDataLayer::name, CustomData::totlayer, and CustomDataLayer::type.
Referenced by blender::ed::geometry::geometry_attribute_convert_exec(), blender::ed::geometry::geometry_attribute_convert_poll(), blender::ed::geometry::geometry_attribute_remove_exec(), and blender::ed::geometry::geometry_attributes_remove_poll().
int* BKE_id_attributes_active_index_p | ( | struct ID * | id | ) |
Definition at line 512 of file attribute.cc.
References GS, id, ID_CV, ID_ME, ID_PT, and ID::name.
Referenced by BKE_id_attributes_active_get(), BKE_id_attributes_active_set(), ED_geometry_attribute_convert(), blender::ed::geometry::geometry_attribute_convert_exec(), and blender::ed::geometry::geometry_attribute_remove_exec().
void BKE_id_attributes_active_set | ( | struct ID * | id, |
struct CustomDataLayer * | layer | ||
) |
Definition at line 488 of file attribute.cc.
References ATTR_DOMAIN_NUM, BKE_id_attributes_active_index_p(), CD_MASK_PROP_ALL, CD_TYPE_AS_MASK, DomainInfo::customdata, get_domains(), CustomData::layers, CustomData::totlayer, and CustomDataLayer::type.
Referenced by blender::ed::geometry::geometry_attribute_add_exec().
struct CustomDataLayer* BKE_id_attributes_color_find | ( | const struct ID * | id, |
const char * | name | ||
) |
Referenced by BKE_remesh_reproject_vertex_paint(), and fill_texpaint_slots_cb().
CustomData* BKE_id_attributes_iterator_next_domain | ( | struct ID * | id, |
struct CustomDataLayer * | layers | ||
) |
Definition at line 529 of file attribute.cc.
References ATTR_DOMAIN_NUM, DomainInfo::customdata, get_domains(), CustomData::layers, and CustomData::totlayer.
int BKE_id_attributes_length | ( | const struct ID * | id, |
eAttrDomainMask | domain_mask, | ||
eCustomDataMask | mask | ||
) |
struct CustomDataLayer* BKE_id_attributes_render_color_get | ( | const struct ID * | id | ) |
Referenced by BKE_remesh_reproject_vertex_paint(), blender::ed::geometry::geometry_color_attribute_add_exec(), GPU_pbvh_attribute_names_update(), GPU_pbvh_mesh_buffers_update(), mesh_cd_calc_used_gpu_layers(), proj_paint_color_attribute_create(), request_active_and_default_color_attributes(), and retrieve_active_attribute_names().
void BKE_id_attributes_render_color_set | ( | struct ID * | id, |
struct CustomDataLayer * | active_layer | ||
) |
Definition at line 727 of file attribute.cc.
References ATTR_DOMAIN_MASK_COLOR, BKE_id_attribute_subset_active_set(), CD_FLAG_COLOR_RENDER, and CD_MASK_COLOR_ALL.
Referenced by BKE_remesh_reproject_vertex_paint(), blo_do_versions_300(), blender::ed::geometry::geometry_color_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_set_render_exec(), blender::ed::geometry::next_color_attribute(), and proj_paint_color_attribute_create().
Referenced by blender::ed::geometry::geometry_attributes_poll().