31 static auto attributes = []() {
36 map.
add_new(
"instance_transform", std::move(instance_transform));
41 map.
add_new(
".reference_index", std::move(reference_index));
50 static Set<StringRef> attributes{
"instance_transform",
".reference_index"};
57 fn.domain_supported = [](
const void * ,
const AttrDomain domain) {
60 fn.domain_size = [](
const void *owner,
const AttrDomain domain) {
62 static_cast<const Instances *
>(owner)->instances_num() :
65 fn.builtin_domain_and_type = [](
const void * ,
66 const StringRef name) -> std::optional<AttributeDomainAndType> {
77 fn.lookup_meta_data = [](
const void *owner,
StringRef name) -> std::optional<AttributeMetaData> {
95 fn.adapt_domain = [](
const void * ,
104 fn.foreach_attribute = [](
const void *owner,
110 const auto get_fn = [&]() {
139 fn.remove = [](
void *owner,
const StringRef name) ->
bool {
143 if (!info->deletable) {
147 const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name);
148 const bool removed =
storage.remove(name);
157 fn.add = [](
void *owner,
166 if (info->domain != domain || info->type != type) {
177 if (
const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name)) {
183 fn.rename = [](
void *owner,
210 if (
const std::optional<AttrUpdateOnChange>
fn =
changed_tags().lookup_try(name)) {
void add_new(const Key &key, const Value &value)
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
void tag_reference_handles_changed()
int instances_num() const
bke::AttributeStorage & attribute_storage()
#define storage(slot, qualifiers)
GAttributeReader attribute_to_reader(const Attribute &attribute, const AttrDomain domain, const int64_t domain_size)
static const auto & array_storage_required()
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)
static const auto & builtin_attributes()
Attribute::DataVariant attribute_init_to_data(const bke::AttrType data_type, const int64_t domain_size, const AttributeInit &initializer, const bool require_array_data)
static void tag_component_reference_index_changed(void *owner)
static constexpr AttributeAccessorFunctions get_instances_accessor_functions()
const AttributeAccessorFunctions & instance_attribute_accessor_functions()
static const auto & changed_tags()
BMesh const char void * data
AttributeValidator validator