|
Blender V4.3
|
Generic geometry attributes built on CustomData. More...
#include <string>#include "BLI_string_ref.hh"#include "BLI_sys_types.h"#include "DNA_customdata_types.h"Go to the source code of this file.
Classes | |
| class | AttributeOwner |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
Macros | |
| #define | ATTR_DOMAIN_AS_MASK(domain) ((AttrDomainMask)((1 << (int)(domain)))) |
| #define | ATTR_DOMAIN_MASK_COLOR ((AttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) |
Typedefs | |
| typedef enum AttrDomainMask | AttrDomainMask |
Enumerations | |
| enum | AttrDomainMask { 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_GREASE_PENCIL_LAYER = (1 << 6) , ATTR_DOMAIN_MASK_ALL = (1 << 7) - 1 } |
| enum class | AttributeOwnerType { Mesh , PointCloud , Curves , GreasePencil , GreasePencilDrawing } |
Generic geometry attributes built on CustomData.
Definition in file BKE_attribute.h.
| #define ATTR_DOMAIN_AS_MASK | ( | domain | ) | ((AttrDomainMask)((1 << (int)(domain)))) |
Definition at line 72 of file BKE_attribute.h.
Referenced by blender::ed::sculpt_paint::color::active_color_attribute(), blender::ed::sculpt_paint::color::active_color_attribute_for_write(), BKE_attribute_search(), BKE_color_attribute_supported(), blender::ed::geometry::geometry_color_attribute_convert_poll(), blender::bke::mesh_ensure_default_color_attribute_on_add(), blender::ed::object::meta_data_matches(), blender::bke::retrieve_attributes_for_transfer(), and blender::ed::sculpt_paint::undo::save_active_attribute().
| #define ATTR_DOMAIN_MASK_COLOR ((AttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) |
Definition at line 75 of file BKE_attribute.h.
Referenced by blender::ed::sculpt_paint::color::active_color_attribute(), blender::ed::sculpt_paint::color::active_color_attribute_for_write(), BKE_color_attribute_supported(), BKE_id_attributes_color_find(), color_clamp_index(), color_name_from_index(), color_name_to_index(), data_transfer_mesh_attributes_transfer_active_color_string(), data_transfer_mesh_attributes_transfer_default_color_string(), blender::ed::geometry::geometry_color_attribute_convert_poll(), blender::bke::mesh_ensure_default_color_attribute_on_add(), blender::ed::object::remove_invalid_attribute_strings(), and blender::ed::sculpt_paint::undo::save_active_attribute().
| typedef enum AttrDomainMask AttrDomainMask |
| enum AttrDomainMask |
| Enumerator | |
|---|---|
| ATTR_DOMAIN_MASK_POINT | |
| ATTR_DOMAIN_MASK_EDGE | |
| ATTR_DOMAIN_MASK_FACE | |
| ATTR_DOMAIN_MASK_CORNER | |
| ATTR_DOMAIN_MASK_CURVE | |
| ATTR_DOMAIN_MASK_GREASE_PENCIL_LAYER | |
| ATTR_DOMAIN_MASK_ALL | |
Definition at line 33 of file BKE_attribute.h.
|
strong |
| Enumerator | |
|---|---|
| Mesh | |
| PointCloud | |
| Curves | |
| GreasePencil | |
| GreasePencilDrawing | |
Definition at line 44 of file BKE_attribute.h.
| std::string BKE_attribute_calc_unique_name | ( | const AttributeOwner & | owner, |
| const blender::StringRef | name ) |
Definition at line 359 of file attribute.cc.
References attribute_name_exists(), BLI_uniquename_cb(), and DATA_.
Referenced by BKE_attribute_duplicate(), BKE_attribute_new(), BKE_attribute_rename(), BKE_sculpt_color_layer_create_if_needed(), ED_mesh_color_ensure(), ED_mesh_uv_add(), ensure_weight_attribute_meta_data(), and get_uv_attribute().
| int BKE_attribute_data_length | ( | AttributeOwner & | owner, |
| struct CustomDataLayer * | layer ) |
Definition at line 736 of file attribute.cc.
References ATTR_DOMAIN_NUM, BLI_assert_msg, blender::Span< T >::contains_ptr(), get_domains(), AttributeOwner::get_mesh(), CustomData::layers, Mesh, CustomData::totlayer, and AttributeOwner::type().
| blender::bke::AttrDomain BKE_attribute_domain | ( | const AttributeOwner & | owner, |
| const struct CustomDataLayer * | layer ) |
Referenced by blender::ed::object::bake_targets_output_vertex_colors(), edbm_select_by_attribute_exec(), edbm_select_by_attribute_poll(), blender::ed::sculpt_paint::fill_mesh_color(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), and blender::ed::mesh::set_attribute::mesh_set_attribute_invoke().
| int BKE_attribute_domain_size | ( | const AttributeOwner & | owner, |
| int | domain ) |
Definition at line 730 of file attribute.cc.
References get_domains().
| struct CustomDataLayer * BKE_attribute_duplicate | ( | AttributeOwner & | owner, |
| const char * | name, | ||
| struct ReportList * | reports ) |
Creates a duplicate attribute layer.
Definition at line 432 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, BKE_attribute_calc_unique_name(), bke_attribute_copy_if_exists(), BKE_attribute_search_for_write(), BKE_report(), BKE_uv_map_edge_select_name_get(), BKE_uv_map_pin_name_get(), BKE_uv_map_vert_select_name_get(), BLI_assert_unreachable, CD_MASK_PROP_ALL, CD_PROP_FLOAT2, blender::bke::GAttributeReader::domain, AttributeOwner::get_mesh(), MAX_CUSTOMDATA_LAYER_NAME, Mesh, RPT_ERROR, AttributeOwner::type(), blender::GVArrayCommon::type(), and blender::bke::GAttributeReader::varray.
Referenced by blender::ed::geometry::geometry_color_attribute_duplicate_exec().
| struct CustomDataLayer * BKE_attribute_find | ( | const AttributeOwner & | owner, |
| const char * | name, | ||
| eCustomDataType | type, | ||
| blender::bke::AttrDomain | domain ) |
Referenced by blender::ed::sculpt_paint::undo::set_active_layer().
| CustomDataLayer * BKE_attribute_from_index | ( | AttributeOwner & | owner, |
| int | lookup_index, | ||
| AttrDomainMask | domain_mask, | ||
| eCustomDataMask | layer_mask ) |
Definition at line 878 of file attribute.cc.
References ATTR_DOMAIN_NUM, CD_FLAG_TEMPORARY, CD_TYPE_AS_MASK, CustomDataLayer::flag, get_domains(), CustomData::layers, CustomData::totlayer, and CustomDataLayer::type.
Referenced by bmo_get_loop_color_ref(), color_name_from_index(), data_transfer_mesh_attributes_transfer_active_color_string(), and data_transfer_mesh_attributes_transfer_default_color_string().
| struct CustomDataLayer * BKE_attribute_new | ( | AttributeOwner & | owner, |
| const char * | name, | ||
| eCustomDataType | type, | ||
| blender::bke::AttrDomain | domain, | ||
| struct ReportList * | reports ) |
Create a new attribute layer.
Referenced by ED_mesh_color_add(), 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_attribute_remove | ( | AttributeOwner & | owner, |
| const char * | name, | ||
| struct ReportList * | reports ) |
Definition at line 501 of file attribute.cc.
References ATTR_DOMAIN_NUM, BKE_attribute_required(), BKE_id_attributes_active_color_set(), BKE_id_attributes_default_color_set(), BKE_report(), BKE_uv_map_edge_select_name_get(), BKE_uv_map_pin_name_get(), BKE_uv_map_vert_select_name_get(), BLI_assert_unreachable, BM_data_layer_free_named(), CD_PROP_FLOAT2, color_clamp_index(), color_name_from_index(), color_name_to_index(), CustomData_get_named_layer_index_notype(), get_domains(), AttributeOwner::get_mesh(), MAX_CUSTOMDATA_LAYER_NAME, Mesh, RPT_ERROR, and AttributeOwner::type().
Referenced by blender::ed::geometry::geometry_attribute_remove_exec(), blender::ed::geometry::geometry_color_attribute_remove_exec(), mesh_customdata_mask_clear_exec(), mesh_uv_texture_remove_exec(), and output_toggle_exec().
| bool BKE_attribute_rename | ( | AttributeOwner & | owner, |
| const char * | old_name, | ||
| const char * | new_name, | ||
| struct ReportList * | reports ) |
Definition at line 253 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, BKE_attribute_calc_unique_name(), BKE_attribute_domain(), bke_attribute_rename_if_exists(), BKE_attribute_required(), BKE_attribute_search_for_write(), BKE_id_attributes_active_color_name(), BKE_id_attributes_active_color_set(), BKE_id_attributes_default_color_name(), BKE_id_attributes_default_color_set(), BKE_report(), BKE_uv_map_edge_select_name_get(), BKE_uv_map_pin_name_get(), BKE_uv_map_vert_select_name_get(), BLI_assert_msg, BLI_strncpy_utf8(), CD_MASK_PROP_ALL, CD_PROP_FLOAT2, CustomData_name_maxncpy_calc(), AttributeOwner::get_mesh(), MAX_CUSTOMDATA_LAYER_NAME, Mesh, mesh_edit_mode_attribute_valid(), RPT_ERROR, STREQ, STRNCPY_UTF8, and AttributeOwner::type().
Referenced by bke_attribute_rename_if_exists(), and blo_do_versions_300().
| bool BKE_attribute_required | ( | const AttributeOwner & | owner, |
| const char * | name ) |
Definition at line 764 of file attribute.cc.
References BKE_curves_attribute_required(), BKE_grease_pencil_drawing_attribute_required(), BKE_mesh_attribute_required(), BKE_pointcloud_attribute_required(), Curves, AttributeOwner::get_curves(), AttributeOwner::get_grease_pencil_drawing(), AttributeOwner::get_pointcloud(), GreasePencil, GreasePencilDrawing, Mesh, PointCloud, and AttributeOwner::type().
Referenced by BKE_attribute_remove(), and BKE_attribute_rename().
| const struct CustomDataLayer * BKE_attribute_search | ( | const AttributeOwner & | owner, |
| const char * | name, | ||
| eCustomDataMask | type, | ||
| AttrDomainMask | domain_mask ) |
Definition at line 636 of file attribute.cc.
References ATTR_DOMAIN_AS_MASK, ATTR_DOMAIN_NUM, CD_TYPE_AS_MASK, get_domains(), int, CustomData::layers, STREQ, and CustomData::totlayer.
Referenced by BKE_attribute_search_for_write(), BKE_attributes_active_set(), BKE_id_attributes_color_find(), color_name_to_index(), data_transfer_mesh_attributes_transfer_active_color_string(), data_transfer_mesh_attributes_transfer_default_color_string(), edbm_reverse_colors_exec(), and edbm_rotate_colors_exec().
| struct CustomDataLayer * BKE_attribute_search_for_write | ( | AttributeOwner & | owner, |
| const char * | name, | ||
| eCustomDataMask | type, | ||
| AttrDomainMask | domain_mask ) |
Definition at line 669 of file attribute.cc.
References BKE_attribute_domain(), BKE_attribute_search(), CustomData_ensure_data_is_mutable(), and get_domains().
Referenced by BKE_attribute_duplicate(), BKE_attribute_rename(), bke_attribute_rename_if_exists(), and blender::ed::sculpt_paint::undo::set_active_layer().
| int BKE_attribute_to_index | ( | const AttributeOwner & | owner, |
| const CustomDataLayer * | layer, | ||
| AttrDomainMask | domain_mask, | ||
| eCustomDataMask | layer_mask ) |
Layer is allowed to be nullptr; if so -1 (layer not found) will be returned.
Definition at line 911 of file attribute.cc.
References ATTR_DOMAIN_NUM, CD_FLAG_TEMPORARY, CD_TYPE_AS_MASK, CustomDataLayer::flag, get_domains(), CustomData::layers, CustomData::totlayer, and CustomDataLayer::type.
Referenced by BKE_attributes_active_set(), color_name_to_index(), edbm_reverse_colors_exec(), and edbm_rotate_colors_exec().
| void BKE_attributes_active_clear | ( | AttributeOwner & | owner | ) |
Definition at line 827 of file attribute.cc.
References BKE_attributes_active_index_p().
| struct CustomDataLayer * BKE_attributes_active_get | ( | AttributeOwner & | owner | ) |
Definition at line 781 of file attribute.cc.
References blender::bke::allow_procedural_attribute_access(), ATTR_DOMAIN_MASK_ALL, ATTR_DOMAIN_NUM, BKE_attributes_active_index_p(), BKE_attributes_length(), CD_MASK_PROP_ALL, CD_TYPE_AS_MASK, get_domains(), CustomData::layers, and CustomData::totlayer.
Referenced by blender::ed::geometry::attribute_set_poll(), blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), edbm_select_by_attribute_exec(), edbm_select_by_attribute_poll(), blender::ed::geometry::geometry_attribute_convert_exec(), blender::ed::geometry::geometry_attribute_convert_invoke(), blender::ed::geometry::geometry_attribute_convert_poll(), blender::ed::geometry::geometry_attribute_remove_exec(), blender::ed::geometry::geometry_attributes_remove_poll(), blender::ed::mesh::set_attribute::mesh_set_attribute_exec(), blender::ed::mesh::set_attribute::mesh_set_attribute_invoke(), blender::ed::mesh::set_attribute::mesh_set_attribute_ui(), blender::ed::curves::set_attribute_exec(), blender::ed::curves::set_attribute_invoke(), and blender::ed::curves::set_attribute_ui().
| int * BKE_attributes_active_index_p | ( | AttributeOwner & | owner | ) |
Definition at line 832 of file attribute.cc.
References CurvesGeometry::attributes_active_index, GreasePencil::attributes_active_index, Mesh::attributes_active_index, PointCloud::attributes_active_index, Curves, Curves::geometry, GreasePencilDrawing::geometry, AttributeOwner::get_curves(), AttributeOwner::get_grease_pencil(), AttributeOwner::get_grease_pencil_drawing(), AttributeOwner::get_mesh(), AttributeOwner::get_pointcloud(), GreasePencil, GreasePencilDrawing, Mesh, PointCloud, and AttributeOwner::type().
Referenced by BKE_attributes_active_clear(), BKE_attributes_active_get(), BKE_attributes_active_set(), blender::ed::geometry::geometry_attribute_convert_exec(), and blender::ed::geometry::geometry_attribute_remove_exec().
| void BKE_attributes_active_set | ( | AttributeOwner & | owner, |
| const char * | name ) |
Definition at line 817 of file attribute.cc.
References ATTR_DOMAIN_MASK_ALL, BKE_attribute_search(), BKE_attribute_to_index(), BKE_attributes_active_index_p(), BLI_assert, and CD_MASK_PROP_ALL.
Referenced by blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), and blender::ed::geometry::geometry_attribute_add_exec().
| CustomData * BKE_attributes_iterator_next_domain | ( | AttributeOwner & | owner, |
| struct CustomDataLayer * | layers ) |
Definition at line 854 of file attribute.cc.
References ATTR_DOMAIN_NUM, get_domains(), CustomData::layers, and CustomData::totlayer.
| int BKE_attributes_length | ( | const AttributeOwner & | owner, |
| AttrDomainMask | domain_mask, | ||
| eCustomDataMask | mask ) |
Definition at line 690 of file attribute.cc.
References ATTR_DOMAIN_NUM, CustomData_number_of_layers_typemask(), get_domains(), and length().
Referenced by BKE_attributes_active_get(), and color_clamp_index().
| bool BKE_color_attribute_supported | ( | const struct Mesh & | mesh, |
| const blender::StringRef | name ) |
| void BKE_id_attributes_active_color_clear | ( | struct ID * | id | ) |
Definition at line 981 of file attribute.cc.
References GS, ID_ME, and MEM_SAFE_FREE.
| const char * BKE_id_attributes_active_color_name | ( | const struct ID * | id | ) |
Referenced by data_transfer_mesh_attributes_transfer_active_color_string(), blender::ed::geometry::geometry_color_attribute_duplicate_exec(), blender::ed::geometry::geometry_color_attribute_remove_exec(), blender::ed::geometry::geometry_color_attributes_duplicate_poll(), and blender::ed::geometry::geometry_color_attributes_remove_poll().
| void BKE_id_attributes_active_color_set | ( | struct ID * | id, |
| const char * | name ) |
Definition at line 965 of file attribute.cc.
References BLI_strdup(), GS, ID_ME, and MEM_SAFE_FREE.
Referenced by BKE_attribute_remove(), BKE_attribute_rename(), BKE_sculpt_color_layer_create_if_needed(), blo_do_versions_300(), blender::io::ply::convert_ply_to_mesh(), ED_mesh_color_add(), ED_mesh_color_ensure(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::ed::geometry::geometry_color_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_duplicate_exec(), blender::bke::mesh_remesh_reproject_attributes(), proj_paint_color_attribute_create(), and blender::ed::sculpt_paint::undo::set_active_layer().
| const struct CustomDataLayer * BKE_id_attributes_color_find | ( | const struct ID * | id, |
| const char * | name ) |
Referenced by blender::ed::object::bake_object_check(), blender::ed::object::bake_targets_init_vertex_colors(), blender::ed::object::bake_targets_output_vertex_colors(), ED_mesh_color_add(), blender::ed::sculpt_paint::fill_mesh_color(), fill_texpaint_slots_cb(), blender::ed::geometry::geometry_color_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_set_render_exec(), blender::ed::geometry::geometry_color_attributes_duplicate_poll(), and blender::ed::geometry::geometry_color_attributes_remove_poll().
| const char * BKE_id_attributes_default_color_name | ( | const struct ID * | id | ) |
| void BKE_id_attributes_default_color_set | ( | struct ID * | id, |
| const char * | name ) |
Definition at line 994 of file attribute.cc.
References BLI_strdup(), GS, ID_ME, and MEM_SAFE_FREE.
Referenced by BKE_attribute_remove(), BKE_attribute_rename(), BKE_sculpt_color_layer_create_if_needed(), blo_do_versions_300(), blender::io::ply::convert_ply_to_mesh(), ED_mesh_color_ensure(), blender::ed::geometry::geometry_color_attribute_add_exec(), blender::ed::geometry::geometry_color_attribute_set_render_exec(), blender::bke::mesh_remesh_reproject_attributes(), and proj_paint_color_attribute_create().
| const char * BKE_uv_map_edge_select_name_get | ( | const char * | uv_map_name, |
| char * | buffer ) |
Definition at line 1040 of file attribute.cc.
References BLI_assert, BLI_snprintf(), MAX_CUSTOMDATA_LAYER_NAME, and UV_EDGESEL_NAME.
Referenced by BKE_attribute_duplicate(), BKE_attribute_remove(), BKE_attribute_rename(), blender::bm_face_loop_table_build(), BM_mesh_bm_from_me(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_select_and_pin_attrs(), BM_uv_map_get_offsets_from_layer(), ED_mesh_uv_map_edge_select_layer_ensure(), and ED_mesh_uv_map_edge_select_layer_get().
| const char * BKE_uv_map_pin_name_get | ( | const char * | uv_map_name, |
| char * | buffer ) |
Definition at line 1048 of file attribute.cc.
References BLI_assert, BLI_snprintf(), MAX_CUSTOMDATA_LAYER_NAME, and UV_PINNED_NAME.
Referenced by BKE_attribute_duplicate(), BKE_attribute_remove(), BKE_attribute_rename(), blender::bm_face_loop_table_build(), BM_mesh_bm_from_me(), BM_uv_map_ensure_pin_attr(), BM_uv_map_ensure_select_and_pin_attrs(), BM_uv_map_get_offsets_from_layer(), ED_mesh_uv_map_pin_layer_ensure(), and ED_mesh_uv_map_pin_layer_get().
| const char * BKE_uv_map_vert_select_name_get | ( | const char * | uv_map_name, |
| char * | buffer ) |
Definition at line 1032 of file attribute.cc.
References BLI_assert, BLI_snprintf(), MAX_CUSTOMDATA_LAYER_NAME, and UV_VERTSEL_NAME.
Referenced by BKE_attribute_duplicate(), BKE_attribute_remove(), BKE_attribute_rename(), blender::bm_face_loop_table_build(), BM_mesh_bm_from_me(), BM_uv_map_ensure_select_and_pin_attrs(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets_from_layer(), ED_mesh_uv_map_vert_select_layer_ensure(), and ED_mesh_uv_map_vert_select_layer_get().
| ENUM_OPERATORS | ( | AttrDomainMask | , |
| ATTR_DOMAIN_MASK_ALL | ) |