diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-20 07:51:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-20 07:51:49 +0400 |
commit | 32f3771d0b27875046724d89309d1a5f73048bc4 (patch) | |
tree | 31288ec29d7a2b9596b5a095fee4e34eef23d907 /source/blender | |
parent | ef4d5991945fb0216d492ff9eda1b9f8f22188fd (diff) |
hidden wireframe option for mesh editmode, important for retopology mode (can be used with xray).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 18 | ||||
-rw-r--r-- | source/blender/editors/util/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 5 |
4 files changed, 23 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 */ diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index ea5e806647f..e72385b311d 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -47,6 +47,7 @@ set(SRC ../include/BIF_glutil.h ../include/ED_anim_api.h ../include/ED_armature.h + ../include/ED_buttons.h ../include/ED_clip.h ../include/ED_curve.h ../include/ED_datafiles.h diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index fc67d2ddd7e..5436b9debfa 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -279,6 +279,8 @@ typedef struct View3D { #define V3D_RENDER_BORDER 2048 #define V3D_SOLID_MATCAP 4096 /* user flag */ #define V3D_SHOW_SOLID_MATCAP 8192 /* runtime flag */ +#define V3D_OCCLUDE_WIRE 16384 + /* View3D->around */ #define V3D_CENTER 0 diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 2555e925eed..f7a0d865274 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1921,6 +1921,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_OCCLUDE_WIRE); + RNA_def_property_ui_text(prop, "Hidden Wire", "Use hidden wireframe display"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_LOCK_CAMERA); RNA_def_property_ui_text(prop, "Lock Camera to View", "Enable view navigation within the camera view"); |