Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-09-05 21:08:07 +0300
committerHans Goudey <h.goudey@me.com>2022-09-05 21:15:13 +0300
commit8e4fb20c36635a9f9a3bf4cdfe792a6011d4f884 (patch)
tree28c64ac15e13a9dbd941a33e1d0bfbe272bf6546 /source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
parente202e27b144265f5de7c1044638057d792b6ffaf (diff)
parent258d3858572b588051814363abe42044eeec3182 (diff)
Merge branch 'master' into refactor-mesh-bevel-weight-generic
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 68f172169f4..3c79e66f436 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -168,45 +168,49 @@ std::unique_ptr<ColumnValues> GeometryDataSource::get_column_values(
else if (G.debug_value == 4001 && component_->type() == GEO_COMPONENT_TYPE_MESH) {
const MeshComponent &component = static_cast<const MeshComponent &>(*component_);
if (const Mesh *mesh = component.get_for_read()) {
+ const Span<MEdge> edges = mesh->edges();
+ const Span<MPoly> polys = mesh->polygons();
+ const Span<MLoop> loops = mesh->loops();
+
if (domain_ == ATTR_DOMAIN_EDGE) {
if (STREQ(column_id.name, "Vertex 1")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totedge, [mesh](int64_t index) {
- return mesh->medge[index].v1;
+ column_id.name, VArray<int>::ForFunc(edges.size(), [edges](int64_t index) {
+ return edges[index].v1;
}));
}
if (STREQ(column_id.name, "Vertex 2")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totedge, [mesh](int64_t index) {
- return mesh->medge[index].v2;
+ column_id.name, VArray<int>::ForFunc(edges.size(), [edges](int64_t index) {
+ return edges[index].v2;
}));
}
}
else if (domain_ == ATTR_DOMAIN_FACE) {
if (STREQ(column_id.name, "Corner Start")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totpoly, [mesh](int64_t index) {
- return mesh->mpoly[index].loopstart;
+ column_id.name, VArray<int>::ForFunc(polys.size(), [polys](int64_t index) {
+ return polys[index].loopstart;
}));
}
if (STREQ(column_id.name, "Corner Size")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totpoly, [mesh](int64_t index) {
- return mesh->mpoly[index].totloop;
+ column_id.name, VArray<int>::ForFunc(polys.size(), [polys](int64_t index) {
+ return polys[index].totloop;
}));
}
}
else if (domain_ == ATTR_DOMAIN_CORNER) {
if (STREQ(column_id.name, "Vertex")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totloop, [mesh](int64_t index) {
- return mesh->mloop[index].v;
+ column_id.name, VArray<int>::ForFunc(loops.size(), [loops](int64_t index) {
+ return loops[index].v;
}));
}
if (STREQ(column_id.name, "Edge")) {
return std::make_unique<ColumnValues>(
- column_id.name, VArray<int>::ForFunc(mesh->totloop, [mesh](int64_t index) {
- return mesh->mloop[index].e;
+ column_id.name, VArray<int>::ForFunc(loops.size(), [loops](int64_t index) {
+ return loops[index].e;
}));
}
}