[Bf-blender-cvs] [4e9d039ef70] blender2.8: 3D View: option not to draw center dots

Campbell Barton noreply at git.blender.org
Wed Jul 11 18:56:46 CEST 2018


Commit: 4e9d039ef70e7593160396b526745c7136cfb85d
Author: Campbell Barton
Date:   Wed Jul 11 18:51:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4e9d039ef70e7593160396b526745c7136cfb85d

3D View: option not to draw center dots

While this is a fairly obscure option,
it means it's possible to disable all overlays except for any
overlays the users wants to see.

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

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/draw/modes/object_mode.c
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index b04c695d6cf..c8a1a9c8ef1 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4045,7 +4045,10 @@ class VIEW3D_PT_overlay_object(Panel):
         sub = split.column(align=True)
         sub.prop(overlay, "show_bones", text="Bones")
         sub.prop(overlay, "show_motion_paths")
-        sub.prop(overlay, "show_all_objects_origin")
+        sub.prop(overlay, "show_object_origins")
+        subsub = sub.column()
+        subsub.active = overlay.show_object_origins
+        subsub.prop(overlay, "show_object_origins_all")
 
 
 class VIEW3D_PT_overlay_geometry(Panel):
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 2a6a7fae612..6c99024312c 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1975,6 +1975,10 @@ static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob)
 
 static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer, View3D *v3d)
 {
+	if (v3d->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_ORIGINS) {
+		return;
+	}
+
 	const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob);
 	DRWShadingGroup *shgroup;
 
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 365fe125e83..e0ab3a744f1 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -388,6 +388,7 @@ enum {
 	V3D_OVERLAY_ONION_SKINS       = (1 << 7),
 	V3D_OVERLAY_HIDE_BONES        = (1 << 8),
 	V3D_OVERLAY_HIDE_OBJECT_XTRAS = (1 << 9),
+	V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10),
 };
 
 /* View3DOverlay->edit_flag */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index b24a9fbeffd..c3378a68884 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2609,7 +2609,12 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
 	                         "Show an outline highlight around selected objects in non-wireframe views");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
-	prop = RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "show_object_origins", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_ORIGINS);
+	RNA_def_property_ui_text(prop, "Object Origins", "Show object center dots");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+	prop = RNA_def_property(srna, "show_object_origins_all", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
 	RNA_def_property_ui_text(prop, "All Object Origins",
 	                         "Show the object origin center dot for all (selected and unselected) objects");



More information about the Bf-blender-cvs mailing list