[Bf-blender-cvs] [9b64927a8aa] master: Merge branch 'blender-v2.93-release'

Jacques Lucke noreply at git.blender.org
Mon Apr 26 09:17:00 CEST 2021


Commit: 9b64927a8aabe3f71784be1022a1daf3fb4e0b28
Author: Jacques Lucke
Date:   Mon Apr 26 09:16:53 2021 +0200
Branches: master
https://developer.blender.org/rB9b64927a8aabe3f71784be1022a1daf3fb4e0b28

Merge branch 'blender-v2.93-release'

===================================================================



===================================================================

diff --cc source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 405f0cd9455,018431225e5..1ae3f462cfa
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@@ -78,85 -57,69 +57,70 @@@ 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: {
-       if (column_id.index < 0 || column_id.index > 1) {
-         return {};
-       }
-       const std::array<const char *, 2> suffixes = {" X", " Y"};
-       const std::string name = StringRef(column_id.name) + suffixes[column_id.index];
        return column_values_from_function(
-           name, domain_size, [varray, axis = column_id.index](int index, CellValue &r_cell_value) {
+           column_id.name,
+           domain_size,
 -          [attribute](int index, CellValue &r_cell_value) {
++          [varray](int index, CellValue &r_cell_value) {
              float2 value;
 -            attribute->get(index, &value);
 +            varray->get(index, &value);
-             r_cell_value.value_float = value[axis];
-           });
+             r_cell_value.value_float2 = value;
+           },
+           default_float2_column_width);
      }
      case CD_PROP_FLOAT3: {
-       if (column_id.index < 0 || column_id.index > 2) {
-         return {};
-       }
-       const std::array<const char *, 3> suffixes = {" X", " Y", " Z"};
-       const std::string name = StringRef(column_id.name) + suffixes[column_id.index];
        return column_values_from_function(
-           name, domain_size, [varray, axis = column_id.index](int index, CellValue &r_cell_value) {
+           column_id.name,
+           domain_size,
 -          [attribute](int index, CellValue &r_cell_value) {
++          [varray](int index, CellValue &r_cell_value) {
              float3 value;
 -            attribute->get(index, &value);
 +            varray->get(index, &value);
-             r_cell_value.value_float = value[axis];
-           });
+             r_cell_value.value_float3 = value;
+           },
+           default_float3_column_width);
      }
      case CD_PROP_COLOR: {
-       if (column_id.index < 0 || column_id.index > 3) {
-         return {};
-       }
-       const std::array<const char *, 4> suffixes = {" R", " G", " B", " A"};
-       const std::string name = StringRef(column_id.name) + suffixes[column_id.index];
        return column_values_from_function(
-           name, domain_size, [varray, axis = column_id.index](int index, CellValue &r_cell_value) {
+           column_id.name,
+           domain_size,
 -          [attribute](int index, CellValue &r_cell_value) {
++          [varray](int index, CellValue &r_cell_value) {
              Color4f value;
 -            attribute->get(index, &value);
 +            varray->get(index, &value);
-             r_cell_value.value_float = value[axis];
-           });
+             r_cell_value.value_color = value;
+           },
+           default_color_column_width);
      }
      default:
        break;



More information about the Bf-blender-cvs mailing list