|
Blender V5.0
|
#include <BKE_attribute.hh>
Inherits blender::bke::AttributeAccessor.
Public Member Functions | |
| MutableAttributeAccessor (void *owner, const AttributeAccessorFunctions &fn) | |
| template<typename T> | |
| AttributeWriter< T > | lookup_for_write (const StringRef attribute_id) |
| template<typename T> | |
| SpanAttributeWriter< T > | lookup_for_write_span (const StringRef attribute_id) |
| bool | add (const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer) |
| template<typename T> | |
| bool | add (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer) |
| template<typename T> | |
| AttributeWriter< T > | lookup_or_add_for_write (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| template<typename T> | |
| SpanAttributeWriter< T > | lookup_or_add_for_write_span (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| template<typename T> | |
| SpanAttributeWriter< T > | lookup_or_add_for_write_only_span (const StringRef attribute_id, const AttrDomain domain) |
| bool | remove (const StringRef attribute_id) |
Attribute API | |
| GAttributeWriter | lookup_for_write (StringRef attribute_id) |
| GSpanAttributeWriter | lookup_for_write_span (StringRef attribute_id) |
| bool | rename (StringRef old_attribute_id, StringRef new_attribute_id) |
| GAttributeWriter | lookup_or_add_for_write (StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| GSpanAttributeWriter | lookup_or_add_for_write_span (StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| GSpanAttributeWriter | lookup_or_add_for_write_only_span (StringRef attribute_id, AttrDomain domain, AttrType data_type) |
| void | remove_anonymous () |
| Public Member Functions inherited from blender::bke::AttributeAccessor | |
| AttributeAccessor (const void *owner, const AttributeAccessorFunctions &fn) | |
| bool | domain_supported (const AttrDomain domain) const |
| int | domain_size (const AttrDomain domain) const |
| bool | is_builtin (const StringRef attribute_id) const |
| std::optional< AttributeDomainAndType > | get_builtin_domain_and_type (const StringRef name) const |
| GPointer | get_builtin_default (const StringRef attribute_id) const |
| GAttributeReader | lookup (const StringRef attribute_id) const |
| GAttributeReader | lookup (const StringRef attribute_id, const AttrDomain domain) const |
| GAttributeReader | lookup (const StringRef attribute_id, const AttrType data_type) const |
| template<typename T> | |
| AttributeReader< T > | lookup (const StringRef attribute_id, const std::optional< AttrDomain > domain=std::nullopt) const |
| template<typename T> | |
| AttributeReader< T > | lookup_or_default (const StringRef attribute_id, const AttrDomain domain, const T &default_value) const |
| AttributeValidator | lookup_validator (const StringRef attribute_id) const |
| GVArray | adapt_domain (const GVArray &varray, const AttrDomain from_domain, const AttrDomain to_domain) const |
| template<typename T> | |
| VArray< T > | adapt_domain (const VArray< T > &varray, const AttrDomain from_domain, const AttrDomain to_domain) const |
| void | foreach_attribute (const FunctionRef< void(const AttributeIter &)> fn) const |
| bool | contains (StringRef attribute_id) const |
| std::optional< AttributeMetaData > | lookup_meta_data (StringRef attribute_id) const |
| GAttributeReader | lookup (StringRef attribute_id, std::optional< AttrDomain > domain, std::optional< AttrType > data_type) const |
| GAttributeReader | lookup_or_default (StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const |
| Set< StringRefNull > | all_ids () const |
Additional Inherited Members | |
| static std::optional< AttributeAccessor > | from_id (const ID &id) |
| Protected Attributes inherited from blender::bke::AttributeAccessor | |
| void * | owner_ |
| const AttributeAccessorFunctions * | fn_ |
Extends AttributeAccessor with methods that allow modifying individual attributes as well as the set of attributes.
Definition at line 729 of file BKE_attribute.hh.
|
inline |
Definition at line 731 of file BKE_attribute.hh.
|
inline |
Definition at line 799 of file BKE_attribute.hh.
|
inline |
Create a new attribute.
Definition at line 785 of file BKE_attribute.hh.
|
inline |
Get a writable attribute or non if it does not exist. Make sure to call #finish after changes are done.
Definition at line 751 of file BKE_attribute.hh.
Get a writable attribute or none if it does not exist. Make sure to call #finish after changes are done.
Definition at line 814 of file attribute_access.cc.
|
inline |
Same as above, but returns a type that makes it easier to work with the attribute as a span.
Definition at line 766 of file BKE_attribute.hh.
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_for_write_span | ( | StringRef | attribute_id | ) |
Same as above, but returns a type that makes it easier to work with the attribute as a span.
Definition at line 834 of file attribute_access.cc.
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 832 of file BKE_attribute.hh.
| GAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| AttrType | data_type, | ||
| const AttributeInit & | initializer = AttributeInitDefaultValue() ) |
Find an attribute with the given id, domain and data type. If it does not exist, create a new attribute. If the attribute does not exist and can't be created (e.g. because it already exists on a different domain or with a different type), none is returned.
Definition at line 843 of file attribute_access.cc.
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 877 of file BKE_attribute.hh.
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| AttrType | data_type ) |
Find an attribute with the given id, domain and data type. If it does not exist, create a new attribute. If the attribute does not exist and can't be created, none is returned.
The "only" in the name indicates that the caller should not read existing values from the span. If the attribute is not stored as span internally, the existing values won't be copied over to the span.
For trivial types, the values in a newly created attribute will not be initialized.
Definition at line 876 of file attribute_access.cc.
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 846 of file BKE_attribute.hh.
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| AttrType | data_type, | ||
| const AttributeInit & | initializer = AttributeInitDefaultValue() ) |
Same as above, but returns a type that makes it easier to work with the attribute as a span. If the caller newly initializes the attribute, it's better to use lookup_or_add_for_write_only_span.
Definition at line 862 of file attribute_access.cc.
|
inline |
Remove an attribute.
Definition at line 894 of file BKE_attribute.hh.
Remove all anonymous attributes.
Definition at line 782 of file attribute_access.cc.
| bool blender::bke::MutableAttributeAccessor::rename | ( | StringRef | old_attribute_id, |
| StringRef | new_attribute_id ) |
Replace the existing attribute with a new one with a different name.
Definition at line 887 of file attribute_access.cc.