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.
This commit is contained in:
Hans Goudey 2021-06-20 17:39:18 -05:00
parent 2d75b39b64
commit 6afafc46f6
Notes: blender-bot 2023-02-14 09:48:23 +01:00
Referenced by issue #90423, Cycles - Render Pass contains black pixels with no values
Referenced by issue #89176, Blender Crash in weight paint mode when wireframe overlay is activated on a mesh with Solidify Modifier
1 changed files with 13 additions and 5 deletions

View File

@ -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