Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-05-05 23:21:30 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-05-05 23:24:13 +0400
commit312d3edee51fd3756319f93369d649c707597325 (patch)
tree1abb325396cebab2cf88fbde9ffab8cdd6d38146 /source/blender/blenkernel/intern/pbvh_bmesh.c
parent90886048117966d673e0a2493a3eae7ed959f607 (diff)
Hidden PBVH nodes:
Set hidden when rebuilding the PBVH tree if all primitives are hidden.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index b5495ded487..83e0d1a4740 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -48,6 +48,7 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index, const int cd_ver
{
GSetIterator gs_iter;
PBVHNode *n = &bvh->nodes[node_index];
+ bool has_visible = false;
/* Create vert hash sets */
n->bm_unique_verts = BLI_gset_ptr_new("bm_unique_verts");
@@ -80,6 +81,9 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index, const int cd_ver
/* Update node bounding box */
BB_expand(&n->vb, v->co);
} while ((l_iter = l_iter->next) != l_first);
+
+ if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN))
+ has_visible = true;
}
BLI_assert(n->vb.bmin[0] <= n->vb.bmax[0] &&
@@ -90,6 +94,8 @@ static void pbvh_bmesh_node_finalize(PBVH *bvh, int node_index, const int cd_ver
/* Build GPU buffers for new node and update vertex normals */
BKE_pbvh_node_mark_rebuild_draw(n);
+
+ BKE_pbvh_node_fully_hidden_set(n, !has_visible);
n->flag |= PBVH_UpdateNormals;
}