Fix T80039: Do not subdivide with Multires is mesh has no faces

This skips the subdivision operation if the mesh has no loops, avoiding
the crash.

Reviewed By: sergey

Maniphest Tasks: T80039

Differential Revision: https://developer.blender.org/D8696
This commit is contained in:
Pablo Dobarro 2020-08-24 18:26:28 +02:00
parent dc74d60915
commit 1bced5884c
Notes: blender-bot 2023-02-14 05:01:20 +01:00
Referenced by issue #80104, Crash on making material local
Referenced by issue #80039, Blender crashes when in the Multresolution modifier we increase the number of subdivisions
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 6 additions and 0 deletions

View File

@ -189,6 +189,12 @@ void multiresModifier_subdivide_to_level(struct Object *object,
}
Mesh *coarse_mesh = object->data;
if (coarse_mesh->totloop == 0) {
/* If there are no loops in the mesh inplies there is no CD_MDISPS as well. So can early output
* from here as there is nothing to subdivide. */
return;
}
MultiresReshapeContext reshape_context;
/* There was no multires at all, all displacement is at 0. Can simply make sure all mdisps grids