From 1648a7903672604dca096d49b282cf737dd9e661 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Mon, 2 Mar 2020 15:00:33 +0100 Subject: Fix T74295: Cloth + Internal springs crashes on a non-polygonal geometry Added check to see if the mesh has any polygons at all. If there are no polygons, the bvh tree data will consist of null pointers, so skip internal springs if this is the case. --- source/blender/blenkernel/intern/cloth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/cloth.c') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 7332c3e0d43..45b3148c656 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1578,7 +1578,7 @@ static int cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) bool use_internal_springs = (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS); - if (use_internal_springs) { + if (use_internal_springs && numpolys > 0) { BVHTreeFromMesh treedata = {NULL}; unsigned int tar_v_idx; BLI_bitmap *verts_used = NULL; -- cgit v1.2.3