Fix #137494: Dyntopo crash after undoing Random Mask

Introduced with 1d83a88fdc.

Pull Request: https://projects.blender.org/blender/blender/pulls/137495
This commit is contained in:
Sean Kim
2025-04-15 03:45:15 +02:00
committed by Sean Kim
parent 0c116e7a83
commit f8622702f5

View File

@@ -237,6 +237,7 @@ static wmOperatorStatus sculpt_mask_init_exec(bContext *C, wmOperator *op)
case bke::pbvh::Type::BMesh: {
MutableSpan<bke::pbvh::BMeshNode> nodes = pbvh.nodes<bke::pbvh::BMeshNode>();
const int offset = CustomData_get_offset_named(&ss.bm->vdata, CD_PROP_FLOAT, ".sculpt_mask");
undo::push_nodes(depsgraph, ob, node_mask, undo::Type::Mask);
node_mask.foreach_index(GrainSize(1), [&](const int i) {
for (BMVert *vert : BKE_pbvh_bmesh_node_unique_verts(&nodes[i])) {
if (BM_elem_flag_test(vert, BM_ELEM_HIDDEN)) {