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:
authorCampbell Barton <ideasman42@gmail.com>2013-07-20 07:51:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-20 07:51:49 +0400
commit32f3771d0b27875046724d89309d1a5f73048bc4 (patch)
tree31288ec29d7a2b9596b5a095fee4e34eef23d907 /source/blender/editors/space_view3d/drawobject.c
parentef4d5991945fb0216d492ff9eda1b9f8f22188fd (diff)
hidden wireframe option for mesh editmode, important for retopology mode (can be used with xray).
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 5c46040a2f9..7f7a97c6836 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -3092,6 +3092,7 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
BMFace *efa_act = BM_mesh_active_face_get(em->bm, false, true); /* annoying but active faces is stored differently */
BMEdge *eed_act = NULL;
BMVert *eve_act = NULL;
+ bool use_occlude_wire = (v3d->flag2 & V3D_OCCLUDE_WIRE) && (dt > OB_WIRE);
// if (cageDM) BLI_assert(!(cageDM->dirty & DM_DIRTY_NORMALS));
if (finalDM) BLI_assert(!(finalDM->dirty & DM_DIRTY_NORMALS));
@@ -3130,7 +3131,13 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
}
}
else if (dt > OB_WIRE) {
- if (check_object_draw_texture(scene, v3d, dt)) {
+ if (use_occlude_wire) {
+ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+ finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts,
+ GPU_enable_material, NULL, me->edit_btmesh, 0);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ }
+ else if (check_object_draw_texture(scene, v3d, dt)) {
if (draw_glsl_material(scene, ob, v3d, dt)) {
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
@@ -3171,8 +3178,8 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
finalDM->drawEdges(finalDM, 1, 0);
}
}
-
- if (me->drawflag & ME_DRAWFACES) { /* transp faces */
+
+ if ((me->drawflag & ME_DRAWFACES) && (use_occlude_wire == false)) { /* transp faces */
unsigned char col1[4], col2[4], col3[4];
#ifdef WITH_FREESTYLE
unsigned char col4[4];
@@ -3311,6 +3318,11 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
bglPolygonOffset(rv3d->dist, 0.0);
GPU_disable_material();
}
+#if 0 /* currently not needed */
+ else if (use_occlude_wire) {
+ bglPolygonOffset(rv3d->dist, 0.0);
+ }
+#endif
}
/* Mesh drawing routines */