[Bf-blender-cvs] [caff955e784] blender-v2.82-release: Fix T74295: Cloth + Internal springs crashes on a non-polygonal geometry

Sebastian Parborg noreply at git.blender.org
Mon Mar 9 20:56:36 CET 2020


Commit: caff955e7845f1b0245ca80845d847ed74bcc657
Author: Sebastian Parborg
Date:   Mon Mar 2 15:00:33 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBcaff955e7845f1b0245ca80845d847ed74bcc657

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.

===================================================================

M	source/blender/blenkernel/intern/cloth.c

===================================================================

diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index c26800aefba..91842734304 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1534,7 +1534,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;



More information about the Bf-blender-cvs mailing list