From 1bced5884c3dd80c74dfdcf621eae3b90d32a662 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Mon, 24 Aug 2020 18:26:28 +0200 Subject: 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 --- source/blender/blenkernel/intern/multires_reshape.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c index 64cc9130e25..f9383a46be0 100644 --- a/source/blender/blenkernel/intern/multires_reshape.c +++ b/source/blender/blenkernel/intern/multires_reshape.c @@ -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 -- cgit v1.2.3