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:
authorJacques Lucke <jacques@blender.org>2021-04-12 10:10:26 +0300
committerJacques Lucke <jacques@blender.org>2021-04-12 10:10:26 +0300
commit59f49072d06859f69e9f6e381f5f7f168ee74d24 (patch)
treea20eaac4e875c625783858af1740e8fb83caed38 /source/blender/editors/space_spreadsheet
parent2a14ab998a576df6ba1fa5dc2c680d9078e58f81 (diff)
Fix T87308: don't show columns when there are no instances
Diffstat (limited to 'source/blender/editors/space_spreadsheet')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc8
1 files changed, 8 insertions, 0 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 337e1e68f1a..f33a6473d45 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -284,6 +284,10 @@ Span<int64_t> GeometryDataSource::get_selected_element_indices() const
void InstancesDataSource::foreach_default_column_ids(
FunctionRef<void(const SpreadsheetColumnID &)> fn) const
{
+ if (component_->instances_amount() == 0) {
+ return;
+ }
+
SpreadsheetColumnID column_id;
column_id.index = -1;
column_id.name = (char *)"Name";
@@ -300,6 +304,10 @@ void InstancesDataSource::foreach_default_column_ids(
std::unique_ptr<ColumnValues> InstancesDataSource::get_column_values(
const SpreadsheetColumnID &column_id) const
{
+ if (component_->instances_amount() == 0) {
+ return {};
+ }
+
const std::array<const char *, 3> suffixes = {" X", " Y", " Z"};
const int size = this->tot_rows();
if (STREQ(column_id.name, "Name")) {