[Bf-blender-cvs] [43b56426f6f] virtual-array-attributes: Merge branch 'master' into virtual-array-attributes
Jacques Lucke
noreply at git.blender.org
Sat Apr 17 14:25:49 CEST 2021
Commit: 43b56426f6f4c2ca8c748b4373dda1af84c043e0
Author: Jacques Lucke
Date: Fri Apr 16 14:54:06 2021 +0200
Branches: virtual-array-attributes
https://developer.blender.org/rB43b56426f6f4c2ca8c748b4373dda1af84c043e0
Merge branch 'master' into virtual-array-attributes
===================================================================
===================================================================
diff --cc source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 8e97ddd86ee,520d29ce306..405f0cd9455
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@@ -78,36 -78,44 +78,45 @@@ std::unique_ptr<ColumnValues> GeometryD
{
std::lock_guard lock{mutex_};
- bke::ReadAttributePtr attribute_ptr = component_->attribute_try_get_for_read(column_id.name);
- if (!attribute_ptr) {
+ bke::ReadAttributeLookup attribute = component_->attribute_try_get_for_read(column_id.name);
+ if (!attribute) {
return {};
}
- const bke::ReadAttribute *attribute = scope_.add(std::move(attribute_ptr), __func__);
- if (attribute->domain() != domain_) {
+ const fn::GVArray *varray = scope_.add(std::move(attribute.varray), __func__);
+ if (attribute.domain != domain_) {
return {};
}
- int domain_size = attribute->size();
- switch (attribute->custom_data_type()) {
+ int domain_size = varray->size();
+ const CustomDataType type = bke::cpp_type_to_custom_data_type(varray->type());
+ switch (type) {
case CD_PROP_FLOAT:
+ if (column_id.index != -1) {
+ return {};
+ }
return column_values_from_function(
- column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) {
+ column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) {
float value;
- attribute->get(index, &value);
+ varray->get(index, &value);
r_cell_value.value_float = value;
});
case CD_PROP_INT32:
+ if (column_id.index != -1) {
+ return {};
+ }
return column_values_from_function(
- column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) {
+ column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) {
int value;
- attribute->get(index, &value);
+ varray->get(index, &value);
r_cell_value.value_int = value;
});
case CD_PROP_BOOL:
+ if (column_id.index != -1) {
+ return {};
+ }
return column_values_from_function(
- column_id.name, domain_size, [attribute](int index, CellValue &r_cell_value) {
+ column_id.name, domain_size, [varray](int index, CellValue &r_cell_value) {
bool value;
- attribute->get(index, &value);
+ varray->get(index, &value);
r_cell_value.value_bool = value;
});
case CD_PROP_FLOAT2: {
More information about the Bf-blender-cvs
mailing list