[Bf-blender-cvs] [e74d7d6f813] blender2.8: 3D View: option to always show center in face mode

Campbell Barton noreply at git.blender.org
Thu Aug 30 08:14:58 CEST 2018


Commit: e74d7d6f81356b8b3a5a843a4dbb87fe1909fb14
Author: Campbell Barton
Date:   Thu Aug 30 16:21:03 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBe74d7d6f81356b8b3a5a843a4dbb87fe1909fb14

3D View: option to always show center in face mode

This matches 2.7x behavior

===================================================================

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

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 07ded525d61..8d2cdd4b11b 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -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)
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c
index 6c86f008e3d..a79c0e2dc31 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -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;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 9e15bd32b3b..a91f2f05c1a 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -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,
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 041fd352658..53c5da243fe 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -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");



More information about the Bf-blender-cvs mailing list