|
Blender V4.5
|
#include <BKE_attribute.hh>
Inherited by blender::bke::MutableAttributeAccessor.
Public Member Functions | |
| 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 eCustomDataType 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 |
Protected Attributes | |
| void * | owner_ |
| const AttributeAccessorFunctions * | fn_ |
Attribute API | |
| 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< eCustomDataType > data_type) const |
| GAttributeReader | lookup_or_default (StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const |
| Set< StringRefNull > | all_ids () const |
| static std::optional< AttributeAccessor > | from_id (const ID &id) |
Provides read-only access to the set of attributes on some geometry.
Note, this does not own the attributes. When the owner is freed, it is invalid to access its attributes.
Definition at line 525 of file BKE_attribute.hh.
|
inline |
Definition at line 544 of file BKE_attribute.hh.
|
inline |
Interpolate data from one domain to another.
Definition at line 691 of file BKE_attribute.hh.
|
inline |
Interpolate data from one domain to another.
Definition at line 702 of file BKE_attribute.hh.
| Set< StringRefNull > blender::bke::AttributeAccessor::all_ids | ( | ) | const |
Get a set of all attributes.
Definition at line 777 of file attribute_access.cc.
| bool blender::bke::AttributeAccessor::contains | ( | StringRef | attribute_id | ) | const |
Definition at line 752 of file attribute_access.cc.
|
inline |
Definition at line 575 of file BKE_attribute.hh.
|
inline |
Definition at line 567 of file BKE_attribute.hh.
|
inline |
Run the provided function for every attribute. Attributes should not be removed or added during iteration.
Definition at line 713 of file BKE_attribute.hh.
|
static |
Construct an AttributeAccessor from an ID.
Definition at line 673 of file attribute_access.cc.
|
inline |
Definition at line 601 of file BKE_attribute.hh.
|
inline |
Definition at line 592 of file BKE_attribute.hh.
|
inline |
Definition at line 584 of file BKE_attribute.hh.
|
inline |
Get read-only access to the attribute. If the attribute does not exist, the return value is empty.
Definition at line 611 of file BKE_attribute.hh.
|
inline |
Get read-only access to the attribute whereby the attribute is interpolated to the given domain. The result may be empty.
Definition at line 628 of file BKE_attribute.hh.
|
inline |
Get read-only access to the attribute whereby the attribute is converted to the given type. The result may be empty.
Definition at line 637 of file BKE_attribute.hh.
|
inline |
Get read-only access to the attribute. If necessary, the attribute is interpolated to the given domain and then converted to the given type, in that order. The result may be empty.
Definition at line 647 of file BKE_attribute.hh.
| GAttributeReader blender::bke::AttributeAccessor::lookup | ( | StringRef | attribute_id, |
| std::optional< AttrDomain > | domain, | ||
| std::optional< eCustomDataType > | data_type ) const |
Get read-only access to the attribute. If necessary, the attribute is interpolated to the given domain, and converted to the given type, in that order. The result may be empty.
Definition at line 722 of file attribute_access.cc.
| std::optional< AttributeMetaData > blender::bke::AttributeAccessor::lookup_meta_data | ( | StringRef | attribute_id | ) | const |
Definition at line 764 of file attribute_access.cc.
|
inline |
Same as the generic version above, but should be used when the type is known at compile time.
Definition at line 670 of file BKE_attribute.hh.
| GAttributeReader blender::bke::AttributeAccessor::lookup_or_default | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| eCustomDataType | data_type, | ||
| const void * | default_value = nullptr ) const |
Get read-only access to the attribute. If necessary, the attribute is interpolated to the given domain and then converted to the given data type, in that order. If the attribute does not exist, a virtual array with the given default value is returned. If the passed in default value is null, the default value of the type is used (generally 0).
Definition at line 735 of file attribute_access.cc.
|
inline |
Same as the generic version above, but should be used when the type is known at compile time.
Definition at line 683 of file BKE_attribute.hh.
|
protected |
Functions that know how to access the attributes stored in the owner above.
Definition at line 541 of file BKE_attribute.hh.
|
protected |
The data that actually owns the attributes, for example, a pointer to a Mesh or PointCloud Most commonly this is a pointer to a Mesh or PointCloud. Under some circumstances this can be null. In that case most methods can't be used. Allowed methods are domain_size, foreach_attribute and is_builtin. We could potentially make these methods accessible without AttributeAccessor and then owner_ could always be non-null.
Definition at line 537 of file BKE_attribute.hh.