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.
This commit is contained in:
Sebastian Parborg 2020-03-02 15:00:33 +01:00
parent 9c4523b1fd
commit 1648a79036
Notes: blender-bot 2023-09-13 08:48:34 +02:00
Referenced by issue #74295, Cloth + Internal springs crashes on a non-polygonal geometry
Referenced by issue #74274, Blender 2.82a proposed revisions
1 changed files with 1 additions and 1 deletions

View File

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