Fix: Sculpt redo crash after undoing addition of mask
Fixes a crash in the following case: Enter sculpt mode -> draw face set -> draw sculpt -> undo * 3 -> redo * 3
This commit is contained in:
parent
67445c2353
commit
db5cae78b7
|
@ -576,6 +576,10 @@ static bool sculpt_undo_restore_mask(bContext *C, SculptUndoNode *unode, bool *m
|
|||
/* Regular mesh restore. */
|
||||
float *vmask = static_cast<float *>(
|
||||
CustomData_get_layer_for_write(&mesh->vert_data, CD_PAINT_MASK, mesh->totvert));
|
||||
if (!vmask) {
|
||||
vmask = static_cast<float *>(
|
||||
CustomData_add_layer(&mesh->vert_data, CD_PAINT_MASK, CD_SET_DEFAULT, mesh->totvert));
|
||||
}
|
||||
ss->vmask = vmask;
|
||||
|
||||
index = unode->index;
|
||||
|
|
Loading…
Reference in New Issue