Fix BKE_bvhtree_from_editmesh_get not setting cached value
The stored value was always false because of shadowing. Also disable unused code.
This commit is contained in:
		@@ -1277,6 +1277,8 @@ static BLI_bitmap *loose_edges_map_get(const MEdge *medge,
 | 
				
			|||||||
  return loose_edges_mask;
 | 
					  return loose_edges_mask;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* TODO: implement hidden check. */
 | 
				
			||||||
 | 
					#if 0
 | 
				
			||||||
static BLI_bitmap *looptri_no_hidden_map_get(const MPoly *mpoly,
 | 
					static BLI_bitmap *looptri_no_hidden_map_get(const MPoly *mpoly,
 | 
				
			||||||
                                             const int looptri_len,
 | 
					                                             const int looptri_len,
 | 
				
			||||||
                                             int *r_looptri_active_len)
 | 
					                                             int *r_looptri_active_len)
 | 
				
			||||||
@@ -1305,6 +1307,7 @@ static BLI_bitmap *looptri_no_hidden_map_get(const MPoly *mpoly,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  return looptri_mask;
 | 
					  return looptri_mask;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Builds or queries a bvhcache for the cache bvhtree of the request type.
 | 
					 * Builds or queries a bvhcache for the cache bvhtree of the request type.
 | 
				
			||||||
@@ -1429,14 +1432,17 @@ BVHTree *BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data,
 | 
				
			|||||||
    case BVHTREE_FROM_LOOPTRI_NO_HIDDEN:
 | 
					    case BVHTREE_FROM_LOOPTRI_NO_HIDDEN:
 | 
				
			||||||
      if (is_cached == false) {
 | 
					      if (is_cached == false) {
 | 
				
			||||||
        const MLoopTri *mlooptri = BKE_mesh_runtime_looptri_ensure(mesh);
 | 
					        const MLoopTri *mlooptri = BKE_mesh_runtime_looptri_ensure(mesh);
 | 
				
			||||||
        BLI_bitmap *looptri_mask = NULL;
 | 
					 | 
				
			||||||
        int looptri_mask_active_len = -1;
 | 
					 | 
				
			||||||
        int looptri_len = BKE_mesh_runtime_looptri_len(mesh);
 | 
					        int looptri_len = BKE_mesh_runtime_looptri_len(mesh);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* TODO: implement hidden check. */
 | 
				
			||||||
 | 
					#if 0
 | 
				
			||||||
 | 
					        int looptri_mask_active_len = -1;
 | 
				
			||||||
 | 
					        BLI_bitmap *looptri_mask = NULL;
 | 
				
			||||||
        if (bvh_cache_type == BVHTREE_FROM_LOOPTRI_NO_HIDDEN) {
 | 
					        if (bvh_cache_type == BVHTREE_FROM_LOOPTRI_NO_HIDDEN) {
 | 
				
			||||||
          looptri_mask = looptri_no_hidden_map_get(
 | 
					          looptri_mask = looptri_no_hidden_map_get(
 | 
				
			||||||
              mesh->mpoly, looptri_len, &looptri_mask_active_len);
 | 
					              mesh->mpoly, looptri_len, &looptri_mask_active_len);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        tree = bvhtree_from_mesh_looptri_ex(data,
 | 
					        tree = bvhtree_from_mesh_looptri_ex(data,
 | 
				
			||||||
                                            mesh->mvert,
 | 
					                                            mesh->mvert,
 | 
				
			||||||
@@ -1502,7 +1508,7 @@ BVHTree *BKE_bvhtree_from_editmesh_get(BVHTreeFromEditMesh *data,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (bvh_cache) {
 | 
					  if (bvh_cache) {
 | 
				
			||||||
    BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
 | 
					    BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
 | 
				
			||||||
    bool is_cached = bvhcache_find(*bvh_cache, bvh_cache_type, &tree);
 | 
					    is_cached = bvhcache_find(*bvh_cache, bvh_cache_type, &tree);
 | 
				
			||||||
    BLI_rw_mutex_unlock(&cache_rwlock);
 | 
					    BLI_rw_mutex_unlock(&cache_rwlock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (is_cached && tree == NULL) {
 | 
					    if (is_cached && tree == NULL) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user