26 static auto attributes = []() {
48 fn.domain_supported = [](
const void * ,
const AttrDomain domain) {
52 fn.builtin_domain_and_type = [](
const void * ,
const StringRef )
53 -> std::optional<AttributeDomainAndType> {
return std::nullopt; };
68 fn.lookup_meta_data = [](
const void *owner,
StringRef name) -> std::optional<AttributeMetaData> {
77 fn.adapt_domain = [](
const void * ,
86 fn.foreach_attribute = [](
const void *owner,
92 const auto get_fn = [&]() {
123 fn.remove = [](
void *owner,
const StringRef name) ->
bool {
127 if (!info->deletable) {
131 const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name);
132 const bool removed =
storage.remove(name);
141 fn.add = [](
void *owner,
150 if (info->domain != domain || info->type != type) {
161 if (
const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name)) {
167 fn.rename = [](
void *owner,
194 if (
const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name)) {
Low-level operations for grease pencil.
std::optional< AttrStorageType > storage_type
const AttributeAccessor * accessor
std::variant< ArrayData, SingleData > DataVariant
AttrDomain domain() const
void assign_data(DataVariant &&data)
AttrType data_type() const
#define storage(slot, qualifiers)
static const auto & array_storage_required()
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)
Set< StringRef > rename_attributes(AttributeStorage &storage, const Map< StringRef, StringRef > &name_map, const bool overwrite, const Map< StringRef, AttrBuiltinInfo > &builtin_attributes, const Set< StringRef > &array_storage_required, const FunctionRef< int(AttrDomain)> domain_size_fn, std::optional< ListBaseT< bDeformGroup > * > vertex_groups, FunctionRef< MutableSpan< MDeformVert >()> get_mutable_dverts)
GAttributeWriter attribute_to_writer(void *owner, const Map< StringRef, AttrUpdateOnChange > &changed_tags, const int64_t domain_size, Attribute &attribute)
Attribute::DataVariant attribute_init_to_data(const bke::AttrType data_type, const int64_t domain_size, const AttributeInit &initializer, const bool require_array_data)
BMesh const char void * data
AttributeValidator validator