|
Blender V5.0
|
#include <BKE_attribute_storage.hh>
Inherits AttributeStorage.
Classes | |
| struct | BlendWriteData |
Additional Inherited Members | |
| Public Attributes inherited from AttributeStorage | |
| struct Attribute * | dna_attributes |
| int | dna_attributes_num |
| char | _pad [4] |
| AttributeStorageRuntimeHandle * | runtime |
Definition at line 131 of file BKE_attribute_storage.hh.
| AttributeStorage::AttributeStorage | ( | ) |
Definition at line 195 of file attribute_storage.cc.
References AttributeStorage::_pad, AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, and AttributeStorage::runtime.
Referenced by AttributeStorage(), AttributeStorage(), operator=(), and operator=().
| AttributeStorage::AttributeStorage | ( | const AttributeStorage & | other | ) |
Definition at line 203 of file attribute_storage.cc.
References AttributeStorage(), AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, foreach(), and AttributeStorage::runtime.
| AttributeStorage::AttributeStorage | ( | AttributeStorage && | other | ) |
Definition at line 224 of file attribute_storage.cc.
References AttributeStorage(), AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, and AttributeStorage::runtime.
| AttributeStorage::~AttributeStorage | ( | ) |
Definition at line 241 of file attribute_storage.cc.
References AttributeStorage::runtime.
| Attribute & AttributeStorage::add | ( | std::string | name, |
| bke::AttrDomain | domain, | ||
| bke::AttrType | data_type, | ||
| Attribute::DataVariant | data ) |
Add an attribute with the given name, which must not already be used by an existing attribute or this will invoke undefined behavior.
Definition at line 285 of file attribute_storage.cc.
References BLI_assert, data, blender::bke::Attribute::data_type(), blender::bke::Attribute::domain(), lookup(), name, ptr, and AttributeStorage::runtime.
Referenced by blender::bke::attribute_legacy_convert_customdata_to_storage(), blender::ed::geometry::geometry_attribute_add_exec(), blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_mutable_attribute(), blender::bke::get_pointcloud_accessor_functions(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| Attribute & AttributeStorage::at_index | ( | int | index | ) |
Return the attribute at the given index.
Definition at line 251 of file attribute_storage.cc.
References AttributeStorage::runtime.
Referenced by BKE_attributes_active_name_get().
| const Attribute & AttributeStorage::at_index | ( | int | index | ) | const |
Definition at line 255 of file attribute_storage.cc.
References AttributeStorage::runtime.
| void AttributeStorage::blend_read | ( | BlendDataReader & | reader | ) |
Read data owned by the AttributeStorage struct. This works by converting the DNA-specific types stored in the files to the runtime data structures.
Definition at line 484 of file attribute_storage.cc.
References BLI_SCOPED_DEFER, BLO_read_string(), BLO_read_struct_array, CLOG_ERROR, Attribute::data, data, Attribute::data_type, AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, Attribute::domain, blender::bke::Attribute::domain(), i, LOG, MEM_SAFE_FREE, Attribute::name, blender::bke::read_attr_data(), blender::bke::read_attr_domain(), AttributeStorage::runtime, and Attribute::storage_type.
| void AttributeStorage::blend_write | ( | BlendWriter & | writer, |
| const BlendWriteData & | write_data ) |
Write the prepared data and the data stored in the DNA fields in the AttributeStorage struct.
Definition at line 626 of file attribute_storage.cc.
References blender::bke::Array, blender::bke::AttributeStorage::BlendWriteData::attributes, BLO_write_string(), BLO_write_struct, BLO_write_struct_array_by_name(), AttributeArray::data, AttributeSingle::data, AttributeStorage::dna_attributes, AttributeStorage::dna_attributes_num, AttributeArray::sharing_info, AttributeSingle::sharing_info, blender::bke::Single, AttributeArray::size, and blender::bke::write_shared_array().
| int AttributeStorage::count | ( | ) | const |
Return the number of attributes.
Definition at line 246 of file attribute_storage.cc.
References AttributeStorage::runtime.
Referenced by BKE_attributes_active_name_get().
| void AttributeStorage::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 452 of file attribute_storage.cc.
References blender::memory_counter::MemoryCounter::add_shared(), blender::bke::attribute_type_to_cpp_type(), data, and AttributeStorage::runtime.
| void AttributeStorage::foreach | ( | FunctionRef< void(Attribute &)> | fn | ) |
Iterate over all attributes, with the order defined by the order of insertion. It is not safe to add or remove attributes while iterating.
Definition at line 126 of file attribute_storage.cc.
References AttributeStorage::runtime.
Referenced by AttributeStorage(), blender::bke::convert_storage_to_customdata(), blender::geometry::reorder_attribute_groups(), shrink_attribute_storage(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| void AttributeStorage::foreach | ( | FunctionRef< void(const Attribute &)> | fn | ) | const |
Definition at line 132 of file attribute_storage.cc.
References AttributeStorage::runtime.
| void AttributeStorage::foreach_with_stop | ( | FunctionRef< bool(Attribute &)> | fn | ) |
Definition at line 139 of file attribute_storage.cc.
References AttributeStorage::runtime.
Referenced by blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), and blender::bke::get_pointcloud_accessor_functions().
| void AttributeStorage::foreach_with_stop | ( | FunctionRef< bool(const Attribute &)> | fn | ) | const |
Definition at line 147 of file attribute_storage.cc.
References AttributeStorage::runtime.
| void AttributeStorage::foreach_working_space_color | ( | const IDTypeForeachColorFunctionCallback & | fn | ) |
Iterate over every color to change it to another colorspace.
Definition at line 659 of file attribute_storage.cc.
References blender::bke::ColorFloat, data, and AttributeStorage::runtime.
| int AttributeStorage::index_of | ( | StringRef | name | ) | const |
Return the index of the attribute with the given name, or -1 if not found.
Definition at line 260 of file attribute_storage.cc.
References name, and AttributeStorage::runtime.
Referenced by BKE_attributes_active_set().
Try to find the attribute with a given name. The non-const overload does not make the attribute data itself mutable.
Definition at line 275 of file attribute_storage.cc.
References name, and AttributeStorage::runtime.
Referenced by add(), BKE_attribute_rename(), blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_mutable_attribute(), blender::bke::get_pointcloud_accessor_functions(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and unique_name_calc().
Definition at line 265 of file attribute_storage.cc.
References name, and AttributeStorage::runtime.
| AttributeStorage & AttributeStorage::operator= | ( | AttributeStorage && | other | ) |
Definition at line 231 of file attribute_storage.cc.
References blender::bke::Attribute::AttributeStorage, and AttributeStorage().
| AttributeStorage & AttributeStorage::operator= | ( | const AttributeStorage & | other | ) |
Definition at line 214 of file attribute_storage.cc.
References blender::bke::Attribute::AttributeStorage, and AttributeStorage().
| bool AttributeStorage::remove | ( | StringRef | name | ) |
Attempt to remove the attribute with the given name, returning true if successful. Should not be called while iterating over attributes.
Definition at line 301 of file attribute_storage.cc.
References name, and AttributeStorage::runtime.
Referenced by blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_mutable_attribute(), and blender::bke::get_pointcloud_accessor_functions().
| void AttributeStorage::rename | ( | StringRef | old_name, |
| std::string | new_name ) |
Change the name of a single existing attribute.
Definition at line 312 of file attribute_storage.cc.
References AttributeStorage::runtime, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by BKE_attribute_rename().
| void AttributeStorage::resize | ( | AttrDomain | domain, |
| int64_t | new_size ) |
Resize the data for a given domain. New values will be default initialized (meaning no zero initialization for trivial types).
Definition at line 325 of file attribute_storage.cc.
References blender::bke::Array, blender::bke::Attribute::assign_data(), blender::bke::attribute_type_to_cpp_type(), blender::CPPType::copy_construct_n(), blender::bke::Attribute::data(), data, blender::bke::Attribute::data_type(), blender::CPPType::default_construct_n(), blender::bke::Attribute::domain(), blender::bke::Attribute::ArrayData::from_uninitialized(), POINTER_OFFSET, blender::bke::Single, blender::CPPType::size, and blender::bke::Attribute::storage_type().
| std::string AttributeStorage::unique_name_calc | ( | StringRef | name | ) | const |
Return a possibly changed version of the input name that is unique within existing names.
Definition at line 306 of file attribute_storage.cc.
References BLI_uniquename_cb(), lookup(), and name.
Referenced by blender::bke::attribute_legacy_convert_customdata_to_storage(), BKE_attribute_calc_unique_name(), blender::ed::geometry::geometry_attribute_add_exec(), and blender::bke::tests::TEST().