23 static auto attributes = []() {
39 fn.domain_supported = [](
const void * ,
const AttrDomain domain) {
43 fn.builtin_domain_and_type = [](
const void * ,
const StringRef )
44 -> std::optional<AttributeDomainAndType> {
return std::nullopt; };
59 fn.adapt_domain = [](
const void * ,
68 fn.foreach_attribute = [](
const void *owner,
74 const auto get_fn = [&]() {
106 if (!info->deletable) {
120 fn.add = [](
void *owner,
129 if (info->domain != domain || info->type != type) {
Low-level operations for grease pencil.
const AttributeAccessor * accessor
Attribute & add(std::string name, bke::AttrDomain domain, bke::AttrType data_type, Attribute::DataVariant data)
Attribute * lookup(StringRef name)
bool remove(StringRef name)
void foreach_with_stop(FunctionRef< bool(Attribute &)> fn)
AttrDomain domain() const
StringRefNull name() const
AttrType data_type() const
static int get_domain_size(const void *owner, const AttrDomain domain)
static const auto & changed_tags()
const AttributeAccessorFunctions & get_attribute_accessor_functions()
static AttributeAccessorFunctions get_grease_pencil_accessor_functions()
static const auto & builtin_attributes()
GAttributeReader attribute_to_reader(const Attribute &attribute, const AttrDomain domain, const int64_t domain_size)
Attribute::DataVariant attribute_init_to_data(const bke::AttrType data_type, const int64_t domain_size, const AttributeInit &initializer)
GAttributeWriter attribute_to_writer(void *owner, const Map< StringRef, AttrUpdateOnChange > &changed_tags, const int64_t domain_size, Attribute &attribute)
struct AttributeStorage attribute_storage
AttributeValidator validator