Fix #117865: "Create Face Sets" operator crashes for multires
The same implementation is used for meshes and multires grids, since face sets are always stored per base mesh fast. We just need to account for that in one place to avoid the crash.
This commit is contained in:
@@ -491,8 +491,10 @@ static void face_sets_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_face_sets.reinitialize(faces.size());
|
||||
MutableSpan<int> new_face_sets = tls.new_face_sets;
|
||||
|
||||
Reference in New Issue
Block a user