[Bf-blender-cvs] [1648a790367] master: Fix T74295: Cloth + Internal springs crashes on a non-polygonal geometry

Sebastian Parborg noreply at git.blender.org
Mon Mar 2 15:01:01 CET 2020


Commit: 1648a7903672604dca096d49b282cf737dd9e661
Author: Sebastian Parborg
Date:   Mon Mar 2 15:00:33 2020 +0100
Branches: master
https://developer.blender.org/rB1648a7903672604dca096d49b282cf737dd9e661

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 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;



More information about the Bf-blender-cvs mailing list