diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-03 18:44:36 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-03 18:44:36 +0300 |
commit | a43ebc63fafeb3b945529117a2efacc80399d272 (patch) | |
tree | d8ab3e90e50177874f2423b3bc1486548dccd7dd /source/blender/blenkernel | |
parent | b46e987a70682fcfc227ec71e9726c3ad6a230db (diff) | |
parent | 265ec400ab1945cd7bc78d50b7d8f184c01fdd10 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenkernel/intern/collision.c
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index d3aa5250955..d7fab317105 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1347,6 +1347,14 @@ void cloth_find_point_contacts(Depsgraph *depsgraph, Object *ob, ClothModifierDa // static collisions //////////////////////////////////////////////////////////// + /* Check we do have collision objects to test against, before doing anything else. */ + collobjs = BKE_collision_objects_create(depsgraph, ob, clmd->coll_parms->group, &numcollobj, eModifierType_Collision); + if (!collobjs) { + *r_collider_contacts = NULL; + *r_totcolliders = 0; + return; + } + // create temporary cloth points bvh cloth_bvh = BLI_bvhtree_new(mvert_num, max_ff(clmd->coll_parms->epsilon, clmd->coll_parms->distance_repel), 4, 6); /* fill tree */ @@ -1361,14 +1369,6 @@ void cloth_find_point_contacts(Depsgraph *depsgraph, Object *ob, ClothModifierDa /* balance tree */ BLI_bvhtree_balance(cloth_bvh); - collobjs = BKE_collision_objects_create(depsgraph, ob, clmd->coll_parms->group, &numcollobj, eModifierType_Collision); - if (!collobjs) { - *r_collider_contacts = NULL; - *r_totcolliders = 0; - BLI_bvhtree_free(cloth_bvh); - return; - } - /* move object to position (step) in time */ for (i = 0; i < numcollobj; i++) { Object *collob= collobjs[i]; |