1
1

Fix: Crash loading autosave/last session file after MPoly removal

We need to check CustomData for the MPoly layer rather
than the deprecated mesh customdata pointer.
This commit is contained in:
2023-04-04 16:13:23 -04:00
parent 4b2ea18ec9
commit e785d956c4

View File

@@ -1630,7 +1630,7 @@ void BKE_mesh_legacy_convert_mpoly_to_material_indices(Mesh *mesh)
using namespace blender;
using namespace blender::bke;
MutableAttributeAccessor attributes = mesh->attributes_for_write();
if (!mesh->mpoly || attributes.contains("material_index")) {
if (!CustomData_has_layer(&mesh->pdata, CD_MPOLY) || attributes.contains("material_index")) {
return;
}
const Span<MPoly> polys(static_cast<const MPoly *>(CustomData_get_layer(&mesh->pdata, CD_MPOLY)),