3D View: option to always show center in face mode
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 06:21:03 +0000 (16:21 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 06:21:03 +0000 (16:21 +1000)
This matches 2.7x behavior

release/scripts/startup/bl_ui/space_view3d.py
source/blender/draw/modes/edit_mesh_mode.c
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesrna/intern/rna_mesh.c

index 07ded525d61f746c68606eec17da2a2e788095d2..8d2cdd4b11b7516ba2989a4b0185e73922014ee5 100644 (file)
@@ -4354,6 +4354,9 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
         sub.prop(data, "show_edges", text="Edges")
         sub = split.column()
         sub.prop(data, "show_faces", text="Faces")
+        sub = split.column()
+        sub.active = view.use_occlude_geometry
+        sub.prop(data, "show_face_center", text="Center")
 
         row = col.row(align=True)
         row.prop(data, "show_edge_crease", text="Creases", toggle=True)
index 6c86f008e3d781de8cc347373a5f85d2549890be..a79c0e2dc3107242e6f0a2509644425f08124ea9 100644 (file)
@@ -559,14 +559,21 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob)
 
                        if (stl->g_data->do_zbufclip) {
                                edit_mesh_add_ob_to_pass(
-                                       scene, ob, stl->g_data->face_occluded_shgrp, stl->g_data->ledges_occluded_shgrp,
-                                       stl->g_data->lverts_occluded_shgrp, stl->g_data->facedot_occluded_shgrp,
+                                       scene, ob,
+                                       stl->g_data->face_occluded_shgrp,
+                                       stl->g_data->ledges_occluded_shgrp,
+                                       stl->g_data->lverts_occluded_shgrp,
+                                       stl->g_data->facedot_occluded_shgrp,
                                        stl->g_data->facefill_occluded_shgrp);
                        }
                        else {
                                edit_mesh_add_ob_to_pass(
-                                       scene, ob, stl->g_data->face_overlay_shgrp, stl->g_data->ledges_overlay_shgrp,
-                                       stl->g_data->lverts_overlay_shgrp, NULL, NULL);
+                                       scene, ob,
+                                       stl->g_data->face_overlay_shgrp,
+                                       stl->g_data->ledges_overlay_shgrp,
+                                       stl->g_data->lverts_overlay_shgrp,
+                                       (me->drawflag & ME_DRAW_FACE_DOT) ? stl->g_data->facedot_overlay_shgrp : NULL,
+                                       NULL);
                        }
 
                        stl->g_data->ghost_ob += (ob->dtx & OB_DRAWXRAY) ? 1 : 0;
index 9e15bd32b3bba1cd763155eccffd89607219cef7..a91f2f05c1a4049f5be724c0415c6c3a0a165559 100644 (file)
@@ -243,7 +243,7 @@ enum {
        ME_DRAW_VNORMALS       = 1 << 3,
 
        ME_DRAWEIGHT           = 1 << 4,
-       /* ME_HIDDENEDGES      = 1 << 5, */  /* DEPRECATED */
+       ME_DRAW_FACE_DOT       = 1 << 5,
 
        ME_DRAWCREASES         = 1 << 6,
        ME_DRAWSEAMS           = 1 << 7,
index 041fd3526580e490eb7a0a275094097672e901be..53c5da243fe3e7f4873e081b2a53e868724f6d05 100644 (file)
@@ -3523,6 +3523,11 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 
+       prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACE_DOT);
+       RNA_def_property_ui_text(prop, "Draw Face Center", "Display face center");
+       RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+
        prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
        RNA_def_property_ui_text(prop, "Draw Creases", "Display creases created for Subdivision Surface modifier");