From 04d37cd88796cb5b2e3cd3dd2ce6fe3f1ef2140f Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Mon, 11 Mar 2024 13:01:24 +0100 Subject: [PATCH] Fix #119309: Face Set from Visible crash with multires Fix is same as 18912561b5 / 72d324bd81 Pull Request: https://projects.blender.org/blender/blender/pulls/119311 --- source/blender/editors/sculpt_paint/sculpt_face_set.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 96566d81ea3..a0bae8dbc24 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -537,7 +537,10 @@ static void clear_face_sets(Object &object, const Span nodes) threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) { Vector &face_indices = all_face_indices.local(); for (PBVHNode *node : nodes.slice(range)) { - const Span faces = bke::pbvh::node_face_indices_calc_mesh(pbvh, *node, face_indices); + const Span faces = + (BKE_pbvh_type(&pbvh) == PBVH_FACES) ? + bke::pbvh::node_face_indices_calc_mesh(pbvh, *node, face_indices) : + bke::pbvh::node_face_indices_calc_grids(pbvh, *node, face_indices); if (std::any_of(faces.begin(), faces.end(), [&](const int face) { return face_sets[face] != default_face_set; }))