DRW: disable wide edges when face-dots are used
authorCampbell Barton <ideasman42@gmail.com>
Wed, 27 Feb 2019 05:01:09 +0000 (16:01 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 27 Feb 2019 05:06:37 +0000 (16:06 +1100)
Users who prefer to use face dot's don't get an advantage from drawing
thicker wire.

Requested by @ward

release/scripts/startup/bl_ui/space_view3d.py
source/blender/draw/modes/edit_mesh_mode.c
source/blender/makesrna/intern/rna_space.c

index 19e9c3f..7a17cb8 100644 (file)
@@ -4936,10 +4936,6 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
         sub = split.column()
         sub.prop(overlay, "show_faces", text="Faces")
         sub = split.column()
-        if shading.type == 'WIREFRAME':
-            sub.active = not shading.show_xray_wireframe
-        else:
-            sub.active = not shading.show_xray
         sub.prop(overlay, "show_face_center", text="Center")
 
         row = col.row(align=True)
index f8bc4ec..d599e39 100644 (file)
@@ -274,6 +274,8 @@ static DRWPass *edit_mesh_create_overlay_pass(
        const bool select_vert = (tsettings->selectmode & SCE_SELECT_VERTEX) != 0;
        const bool select_face = (tsettings->selectmode & SCE_SELECT_FACE) != 0;
        const bool select_edge = (tsettings->selectmode & SCE_SELECT_EDGE) != 0;
+       const bool show_wide_edge = select_edge && !(draw_ctx->v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT);
+
        float winmat[4][4];
        float viewdist = rv3d->dist;
        DRW_viewport_matrix_get(winmat, DRW_MAT_WIN);
@@ -326,7 +328,7 @@ static DRWPass *edit_mesh_create_overlay_pass(
        DRW_shgroup_uniform_ivec4(grp, "dataMask", data_mask, 1);
        DRW_shgroup_uniform_bool_copy(grp, "doEdges", do_edges);
        DRW_shgroup_uniform_float_copy(grp, "ofs", depth_ofs);
-       DRW_shgroup_uniform_float_copy(grp, "edgeScale", select_edge ? 1.75f : 1.0f);
+       DRW_shgroup_uniform_float_copy(grp, "edgeScale", show_wide_edge ? 1.75f : 1.0f);
        DRW_shgroup_state_enable(grp, DRW_STATE_OFFSET_NEGATIVE);
        /* To match blender loop structure. */
        DRW_shgroup_state_enable(grp, DRW_STATE_FIRST_VERTEX_CONVENTION);
index ccc18b4..8a38051 100644 (file)
@@ -2857,7 +2857,8 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
 
        prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT);
-       RNA_def_property_ui_text(prop, "Draw Face Center", "Display face center");
+       RNA_def_property_ui_text(prop, "Draw Face Center", "Display face center "
+                                "(when disabled, edges display wider in edge mode)");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
        prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);