|
Blender V5.0
|
#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 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 |
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< 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 |
| 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 524 of file BKE_attribute.hh.
|
inline |
Definition at line 543 of file BKE_attribute.hh.
|
inline |
Interpolate data from one domain to another.
Definition at line 690 of file BKE_attribute.hh.
|
inline |
Interpolate data from one domain to another.
Definition at line 701 of file BKE_attribute.hh.
| Set< StringRefNull > blender::bke::AttributeAccessor::all_ids | ( | ) | const |
Get a set of all attributes.
Definition at line 775 of file attribute_access.cc.
| bool blender::bke::AttributeAccessor::contains | ( | StringRef | attribute_id | ) | const |
Definition at line 750 of file attribute_access.cc.
|
inline |
Definition at line 574 of file BKE_attribute.hh.
|
inline |
Definition at line 566 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 712 of file BKE_attribute.hh.
|
static |
Construct an AttributeAccessor from an ID.
Definition at line 671 of file attribute_access.cc.
|
inline |
Definition at line 600 of file BKE_attribute.hh.
|
inline |
Definition at line 591 of file BKE_attribute.hh.
|
inline |
Definition at line 583 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 610 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 627 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 636 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 646 of file BKE_attribute.hh.
| GAttributeReader blender::bke::AttributeAccessor::lookup | ( | StringRef | attribute_id, |
| std::optional< AttrDomain > | domain, | ||
| std::optional< AttrType > | 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 719 of file attribute_access.cc.
| std::optional< AttributeMetaData > blender::bke::AttributeAccessor::lookup_meta_data | ( | StringRef | attribute_id | ) | const |
Definition at line 762 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 669 of file BKE_attribute.hh.
| GAttributeReader blender::bke::AttributeAccessor::lookup_or_default | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| AttrType | 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 733 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 682 of file BKE_attribute.hh.
|
protected |
Functions that know how to access the attributes stored in the owner above.
Definition at line 540 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 536 of file BKE_attribute.hh.