assertion when bvhtree_from_mesh_faces is called and tessfaces dont exist.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 23 Jan 2012 20:46:38 +0000 (20:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Jan 2012 20:46:38 +0000 (20:46 +0000)
source/blender/blenkernel/intern/bvhutils.c

index 1c70e47a538a88c00133ab7378bb12d8ac007ae0..c9ab126d7abfba5512d8931f459c2c2a36d59181 100644 (file)
@@ -574,6 +574,13 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                int i;
                int numFaces= mesh->getNumTessFaces(mesh);
 
+               /* BMESH spesific check that we have tessfaces,
+                * we _could_ tesselate here but rather not - campbell
+                *
+                * this assert checks we have tessfaces,
+                * if not caller should use DM_ensure_tessface() */
+               BLI_assert(!(numFaces == 0 && mesh->getNumPolys(mesh) != 0));
+
                if(numFaces != 0)
                {
                        /* Create a bvh-tree of the given target */