Fix #118163: Crash hiding face sets with multires

Caused by ce4ec6d42b
Crash occurs due to accessing `corner_tri_faces` when pbvh tpye is
"grid".
Fix is same as 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/118183
This commit is contained in:
Pratik Borhade
2024-02-14 11:37:11 +01:00
committed by Pratik Borhade
parent 0b9ec567c8
commit 18912561b5

View File

@@ -982,8 +982,10 @@ static void face_hide_update(Object &object,
threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) {
TLS &tls = all_tls.local();
for (PBVHNode *node : nodes.slice(range)) {
const Span<int> faces = bke::pbvh::node_face_indices_calc_mesh(
pbvh, *node, tls.face_indices);
const Span<int> faces =
(BKE_pbvh_type(&pbvh) == PBVH_FACES) ?
bke::pbvh::node_face_indices_calc_mesh(pbvh, *node, tls.face_indices) :
bke::pbvh::node_face_indices_calc_grids(pbvh, *node, tls.face_indices);
tls.new_hide.reinitialize(faces.size());
MutableSpan<bool> new_hide = tls.new_hide;