Sculpt: Fix crash when sculpting after disabling dyntopo

Attributes weren't being reinitialized properly.
This commit is contained in:
Joseph Eagar 2022-12-08 04:40:42 -08:00
parent a84384a56f
commit 8e46ef2fa5
2 changed files with 7 additions and 3 deletions

@ -1 +1 @@
Subproject commit fdfd24de034d4bba4fb67731d0aae81dc4940239
Subproject commit 0b0052bd53ad8249ed07dfb87705c338af698bde

View File

@ -2571,15 +2571,19 @@ static bool sculpt_attr_update(Object *ob, SculptAttribute *attr)
if (bad) {
MEM_SAFE_FREE(attr->data);
}
else {
attr->data_for_bmesh = false;
}
}
else {
CustomData *cdata = sculpt_get_cdata(ob, attr->domain);
if (cdata) {
int layer_index = CustomData_get_named_layer_index(cdata, attr->proptype, attr->name);
bad = layer_index == -1;
if (ss->bm) {
bad |= (ss->bm != nullptr) != attr->data_for_bmesh;
if (attr->data_for_bmesh) {
attr->bmesh_cd_offset = cdata->layers[layer_index].offset;
}
}