Fix T58310: Crash when removing multires modifier from sculpt object
This commit is contained in:
@@ -1163,6 +1163,11 @@ bool multiresModifier_reshapeFromCCG(
|
||||
return false;
|
||||
}
|
||||
MDisps *mdisps = CustomData_get_layer(&coarse_mesh->ldata, CD_MDISPS);
|
||||
if (mdisps == NULL) {
|
||||
/* Multires displacement has been removed before current changes were
|
||||
* applies to all the levels. */
|
||||
return false;
|
||||
}
|
||||
GridPaintMask *grid_paint_mask =
|
||||
CustomData_get_layer(&coarse_mesh->ldata, CD_GRID_PAINT_MASK);
|
||||
Subdiv *subdiv = subdiv_ccg->subdiv;
|
||||
|
||||
@@ -425,6 +425,9 @@ static void object_update_from_subsurf_ccg(Object *object)
|
||||
Mesh *mesh_cow = object->runtime.mesh_orig;
|
||||
copy_ccg_data(mesh_cow, mesh_orig, CD_MDISPS);
|
||||
copy_ccg_data(mesh_cow, mesh_orig, CD_GRID_PAINT_MASK);
|
||||
/* Everything is now up-to-date. */
|
||||
subdiv_ccg->dirty.coords = false;
|
||||
subdiv_ccg->dirty.hidden = false;
|
||||
}
|
||||
|
||||
/* free data derived from mesh, called when mesh changes or is freed */
|
||||
|
||||
Reference in New Issue
Block a user