[Bf-blender-cvs] [817bb5d40d2] blender2.8: Remove unused function: `BKE_bvhtree_from_mesh_looptri`.

Germano noreply at git.blender.org
Sat May 12 17:06:03 CEST 2018


Commit: 817bb5d40d2335f2945fbc25e47be7ef213478a4
Author: Germano
Date:   Sat May 12 12:05:54 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB817bb5d40d2335f2945fbc25e47be7ef213478a4

Remove unused function: `BKE_bvhtree_from_mesh_looptri`.

===================================================================

M	source/blender/blenkernel/BKE_bvhutils.h
M	source/blender/blenkernel/intern/bvhutils.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 1fcb5be127b..09248bc2342 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -143,8 +143,6 @@ BVHTree *bvhtree_from_editmesh_looptri_ex(
         const BLI_bitmap *mask, int looptri_num_active,
         float epsilon, int tree_type, int axis, BVHCache **bvhCache);
 
-BVHTree *BKE_bvhtree_from_mesh_looptri(
-        struct BVHTreeFromMesh *data, struct Mesh *mesh, float epsilon, int tree_type, int axis);
 BVHTree *bvhtree_from_mesh_looptri_ex(
         struct BVHTreeFromMesh *data,
         const struct MVert *vert, const bool vert_allocated,
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 1d7ae76d1f9..b5409584f58 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1257,70 +1257,6 @@ BVHTree *bvhtree_from_mesh_get(
 	return tree;
 }
 
-/* This is a Mesh-specific copy of bvhtree_from_mesh_looptri() */
-/**
- * Builds a bvh tree where nodes are the looptri faces of the given mesh.
- *
- * \note for editmesh this is currently a duplicate of bvhtree_from_mesh_faces
- */
-BVHTree *BKE_bvhtree_from_mesh_looptri(
-        BVHTreeFromMesh *data, Mesh *mesh,
-        float epsilon, int tree_type, int axis)
-{
-	BVHTree *tree;
-	MVert *mvert = NULL;
-	MLoop *mloop = NULL;
-	const MLoopTri *looptri = NULL;
-
-	BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
-	tree = bvhcache_find(mesh->runtime.bvh_cache, BVHTREE_FROM_LOOPTRI);
-	BLI_rw_mutex_unlock(&cache_rwlock);
-
-	mvert = mesh->mvert;
-	mloop = mesh->mloop;
-	looptri = BKE_mesh_runtime_looptri_ensure(mesh);
-
-	/* Not in cache */
-	if (tree == NULL) {
-		BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_WRITE);
-		tree = bvhcache_find(mesh->runtime.bvh_cache, BVHTREE_FROM_LOOPTRI);
-		if (tree == NULL) {
-			int looptri_num = BKE_mesh_runtime_looptri_len(mesh);
-
-			/* this assert checks we have looptris,
-			 * if not caller should use DM_ensure_looptri() */
-			BLI_assert(!(looptri_num == 0 && mesh->totpoly != 0));
-
-			tree = bvhtree_from_mesh_looptri_create_tree(
-			        epsilon, tree_type, axis,
-			        mvert, mloop, looptri, looptri_num, NULL, -1);
-			if (tree) {
-				/* Save on cache for later use */
-				/* printf("BVHTree built and saved on cache\n"); */
-				bvhcache_insert(&mesh->runtime.bvh_cache, tree, BVHTREE_FROM_LOOPTRI);
-			}
-		}
-		BLI_rw_mutex_unlock(&cache_rwlock);
-	}
-	else {
-		/* printf("BVHTree is already build, using cached tree\n"); */
-	}
-
-	if (tree) {
-		/* Setup BVHTreeFromMesh */
-		bvhtree_from_mesh_looptri_setup_data(
-		        data, tree, true,
-		        mvert, false,
-		        mloop, false,
-		        looptri, false);
-	}
-	else {
-		memset(data, 0, sizeof(*data));
-	}
-
-	return tree;
-}
-
 /**
  * Builds or queries a bvhcache for the cache bvhtree of the request type.
  */



More information about the Bf-blender-cvs mailing list