Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-08-24 19:26:28 +0300
committerJeroen Bakker <jeroen@blender.org>2020-08-26 12:48:15 +0300
commitdc61f7c17178372e1c52d0e2e3ee8297d36d91b9 (patch)
treeca71026e1a94a498aef4eb09591d5617d2e40a90
parentdedab68dcce0f2880f0678e7cfa80e0261b0de72 (diff)
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
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index 01e7b87cac0..3ae4012928c 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -180,6 +180,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