Differential D11104 Diff 36588 source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
| Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (component_->instances_amount() == 0) { | if (component_->instances_amount() == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| SpreadsheetColumnID column_id; | SpreadsheetColumnID column_id; | ||||
| column_id.name = (char *)"Name"; | column_id.name = (char *)"Name"; | ||||
| fn(column_id); | fn(column_id); | ||||
| for (const char *name : {"Position", "Rotation", "Scale"}) { | for (const char *name : {"Position", "Rotation", "Scale", "ID"}) { | ||||
| column_id.name = (char *)name; | column_id.name = (char *)name; | ||||
| fn(column_id); | fn(column_id); | ||||
| } | } | ||||
| } | } | ||||
| std::unique_ptr<ColumnValues> InstancesDataSource::get_column_values( | std::unique_ptr<ColumnValues> InstancesDataSource::get_column_values( | ||||
| const SpreadsheetColumnID &column_id) const | const SpreadsheetColumnID &column_id) const | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (STREQ(column_id.name, "Scale")) { | ||||
| return column_values_from_function( | return column_values_from_function( | ||||
| column_id.name, | column_id.name, | ||||
| size, | size, | ||||
| [transforms](int index, CellValue &r_cell_value) { | [transforms](int index, CellValue &r_cell_value) { | ||||
| r_cell_value.value_float3 = transforms[index].scale(); | r_cell_value.value_float3 = transforms[index].scale(); | ||||
| }, | }, | ||||
| default_float3_column_width); | default_float3_column_width); | ||||
| } | } | ||||
| Span<int> ids = component_->ids(); | |||||
| if (STREQ(column_id.name, "ID")) { | |||||
| /* Make the column a bit wider by default, since the IDs tend to be large numbers. */ | |||||
| return column_values_from_function( | |||||
| column_id.name, | |||||
| size, | |||||
| [ids](int index, CellValue &r_cell_value) { r_cell_value.value_int = ids[index]; }, | |||||
| 5.5f); | |||||
| } | |||||
| return {}; | return {}; | ||||
| } | } | ||||
| int InstancesDataSource::tot_rows() const | int InstancesDataSource::tot_rows() const | ||||
| { | { | ||||
| return component_->instances_amount(); | return component_->instances_amount(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines | |||||