Attributes: Integrate implicit sharing with the attribute API #107059
|
@ -161,8 +161,12 @@ static void add_instances_from_component(
|
|||
bke::MutableAttributeAccessor dst_attributes = dst_component.attributes_for_write();
|
||||
for (const auto item : attributes_to_propagate.items()) {
|
||||
const AttributeIDRef &id = item.key;
|
||||
|
||||
const bke::GAttributeReader src = src_attributes.lookup(id, ATTR_DOMAIN_POINT);
|
||||
if (!src) {
|
||||
/* Domain interpolation can fail if the source domain is empty. */
|
||||
continue;
|
||||
}
|
||||
|
||||
const eCustomDataType type = bke::cpp_type_to_custom_data_type(src.varray.type());
|
||||
if (src.varray.size() == dst_component.instances_num() && src.sharing_info) {
|
||||
const bke::AttributeInitShared init(src.varray.get_internal_span().data(),
|
||||
|
|
|
@ -115,6 +115,11 @@ static void geometry_set_mesh_to_points(GeometrySet &geometry_set,
|
|||
const AttributeIDRef attribute_id = entry.key;
|
||||
const eCustomDataType data_type = entry.value.data_type;
|
||||
const bke::GAttributeReader src = src_attributes.lookup(attribute_id, domain, data_type);
|
||||
if (!src) {
|
||||
/* Domain interpolation can fail if the source domain is empty. */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (share_arrays && src.domain == domain && src.sharing_info) {
|
||||
const bke::AttributeInitShared init(src.varray.get_internal_span().data(),
|
||||
*src.sharing_info);
|
||||
|
|
Loading…
Reference in New Issue