diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-05 23:00:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-05 23:14:36 +0300 |
commit | cc650c3d075566c760088e59a316c7efee14fd4a (patch) | |
tree | 86fa7276fdc5b0eef0e95a7b863bb05f79b9c971 /source/blender/blenkernel | |
parent | 7efdee75177eb43909e825499330c554d91853f1 (diff) |
Add asserts to check bvhutils args are correct
Would have prevented previous error going unnoticed.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 5e9c18544b7..a2998e869af 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -419,6 +419,7 @@ static BVHTree *bvhtree_from_editmesh_verts_create_tree( } BLI_bvhtree_insert(tree, i, eve->co, 1); } + BLI_assert(BLI_bvhtree_get_size(tree) == verts_num_active); BLI_bvhtree_balance(tree); } @@ -454,7 +455,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree( } BLI_bvhtree_insert(tree, i, vert[i].co, 1); } - + BLI_assert(BLI_bvhtree_get_size(tree) == verts_num_active); BLI_bvhtree_balance(tree); } } @@ -728,6 +729,7 @@ static BVHTree *bvhtree_from_mesh_faces_create_tree( BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } } + BLI_assert(BLI_bvhtree_get_size(tree) == faces_num_active); BLI_bvhtree_balance(tree); } } @@ -892,6 +894,7 @@ static BVHTree *bvhtree_from_editmesh_looptri_create_tree( } } } + BLI_assert(BLI_bvhtree_get_size(tree) == looptri_num_active); BLI_bvhtree_balance(tree); } } @@ -938,6 +941,7 @@ static BVHTree *bvhtree_from_mesh_looptri_create_tree( BLI_bvhtree_insert(tree, i, co[0], 3); } } + BLI_assert(BLI_bvhtree_get_size(tree) == looptri_num_active); BLI_bvhtree_balance(tree); } } |