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>2021-06-21 01:39:18 +0300
committerHans Goudey <h.goudey@me.com>2021-06-21 01:39:18 +0300
commit6afafc46f639c49a0d12a22c3ce298c6b6396ec9 (patch)
treec8c31ca983376627306c66a9d1928482a18359e2 /source/blender/editors
parent2d75b39b6412612f1a5c04b08656d7390ede0ba5 (diff)
Fix: Spreadsheet selection filter crash on non-mesh components
The spreadsheet filter tried to apply the mesh selection filter on non- mesh geometry components. Add a check for the component type, and also refactor the function to be more easily readable.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc18
1 files changed, 13 insertions, 5 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 77248254d7b..0c76c8b7a15 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -226,15 +226,23 @@ static void get_selected_indices_on_domain(const Mesh &mesh,
}
}
+/**
+ * Only data sets corresponding to mesh objects in edit mode currently support selection filtering.
+ */
bool GeometryDataSource::has_selection_filter() const
{
Object *object_orig = DEG_get_original_object(object_eval_);
- if (object_orig->type == OB_MESH) {
- if (object_orig->mode == OB_MODE_EDIT) {
- return true;
- }
+ if (object_orig->type != OB_MESH) {
+ return false;
}
- return false;
+ if (object_orig->mode != OB_MODE_EDIT) {
+ return false;
+ }
+ if (component_->type() != GEO_COMPONENT_TYPE_MESH) {
+ return false;
+ }
+
+ return true;
}
void GeometryDataSource::apply_selection_filter(MutableSpan<bool> rows_included) const