diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 2 | ||||
-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 |
5 files changed, 25 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 2bbfd26f5f3..fcd1529bb44 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2580,6 +2580,8 @@ class VIEW3D_PT_view3d_display(Panel): if view.use_matcap: col.template_icon_view(view, "matcap_icon") col.prop(view, "show_backface_culling") + if ob.mode == 'EDIT' and view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'}: + col.prop(view, "show_occlude_wire") layout.separator() 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"); |