[Bf-blender-cvs] [93d30d62e6e] master: User Prefs: app-template option to hide the cursor

Campbell Barton noreply at git.blender.org
Fri Jan 12 02:37:43 CET 2018


Commit: 93d30d62e6e46b0eb852c86053d9529495050c5d
Author: Campbell Barton
Date:   Fri Jan 12 12:41:03 2018 +1100
Branches: master
https://developer.blender.org/rB93d30d62e6e46b0eb852c86053d9529495050c5d

User Prefs: app-template option to hide the cursor

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 3516085602e..cb088f00714 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -320,6 +320,7 @@ class USERPREF_PT_interface(Panel):
         col.label(text="App Template:")
         col.label(text="Options intended for use with app-templates only.")
         col.prop(view, "show_layout_ui")
+        col.prop(view, "show_view3d_cursor")
 
 
 
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 9e220f4b141..694434d87e8 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3934,6 +3934,10 @@ static void view3d_main_region_draw_objects(const bContext *C, Scene *scene, Vie
 
 static bool is_cursor_visible(Scene *scene)
 {
+	if (U.app_flag & USER_APP_VIEW3D_HIDE_CURSOR) {
+		return false;
+	}
+
 	Object *ob = OBACT;
 
 	/* don't draw cursor in paint modes, but with a few exceptions */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 3d3e9d1704b..c1ba808ec03 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -710,6 +710,7 @@ typedef enum eUserpref_UI_Flag2 {
 /* UserDef.app_flag */
 typedef enum eUserpref_APP_Flag {
 	USER_APP_LOCK_UI_LAYOUT = (1 << 0),
+	USER_APP_VIEW3D_HIDE_CURSOR = (1 << 1),
 } eUserpref_APP_Flag;
 
 /* Auto-Keying mode.
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1258febab61..df74fc12ae1 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3408,6 +3408,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Show Layout Widgets", "Show screen layout editing UI");
 	RNA_def_property_update(prop, 0, "rna_userdef_update_ui");
 
+	prop = RNA_def_property(srna, "show_view3d_cursor", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_VIEW3D_HIDE_CURSOR);
+	RNA_def_property_ui_text(prop, "Show 3D View Cursor", "");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
+
 	/* menus */
 	prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);



More information about the Bf-blender-cvs mailing list