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:
authorNicholas Bishop <nicholasbishop@gmail.com>2013-01-19 20:10:21 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2013-01-19 20:10:21 +0400
commit9a50f454697e5dea6e8603aa90fadaa6156657d6 (patch)
tree150f678940c8bb280697a0fde95e203c1fc3f7f4 /source/blender/blenkernel/intern/paint.c
parent399763015769ca8e35a5639748c9bb08fbfd984b (diff)
Skip hidden faces in PBVH BMesh ray intersection test
Moved the GPU function gpu_bmesh_face_visible() to BKE_paint and inverted the test to match equivalent tests for other mesh types: paint_is_bmesh_face_hidden(). Changed BKE_pbvh_bmesh_node_save_orig() to not save hidden faces into the triangle array. Modified the non-use-original branch of pbvh_bmesh_node_raycast() to skip hidden faces. Fixes bug #33914: projects.blender.org/tracker/index.php?func=detail&aid=33914&group_id=9&atid=498
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 5847e7508f0..dc8aed91c00 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -47,6 +47,8 @@
#include "BKE_paint.h"
#include "BKE_subsurf.h"
+#include "bmesh.h"
+
#include <stdlib.h>
#include <string.h>
@@ -224,6 +226,22 @@ int paint_is_grid_face_hidden(const unsigned int *grid_hidden,
BLI_BITMAP_GET(grid_hidden, (y + 1) * gridsize + x));
}
+/* Return TRUE if all vertices in the face are visible, FALSE otherwise */
+int paint_is_bmesh_face_hidden(BMFace *f)
+{
+ BMLoop *l_iter;
+ BMLoop *l_first;
+
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f);
+ do {
+ if (BM_elem_flag_test(l_iter->v, BM_ELEM_HIDDEN)) {
+ return true;
+ }
+ } while ((l_iter = l_iter->next) != l_first);
+
+ return false;
+}
+
float paint_grid_paint_mask(const GridPaintMask *gpm, unsigned level,
unsigned x, unsigned y)
{