[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50944] trunk/blender: Fix #32671: new orbit sensitivity and turntable/trackball choice was only available

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Sep 28 14:37:15 CEST 2012


Revision: 50944
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50944
Author:   blendix
Date:     2012-09-28 12:37:14 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Fix #32671: new orbit sensitivity and turntable/trackball choice was only available
from special NDOF menu, added them in user preferences as well now. Also made it do
proper version patch for conversion from old user preferences, and changed turntable
choice from a boolean to enum for consistency.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-09-28 12:01:21 UTC (rev 50943)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-09-28 12:37:14 UTC (rev 50944)
@@ -866,7 +866,7 @@
 
             layout.separator()
             layout.label(text="Orbit options")
-            layout.prop(input_prefs, "ndof_turntable")
+            layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
             layout.prop(input_prefs, "ndof_roll_invert_axis")
             layout.prop(input_prefs, "ndof_tilt_invert_axis")
             layout.prop(input_prefs, "ndof_rotate_invert_axis")
@@ -953,6 +953,8 @@
         sub = col.column()
         sub.label(text="NDOF Device:")
         sub.prop(inputs, "ndof_sensitivity", text="NDOF Sensitivity")
+        sub.prop(inputs, "ndof_orbit_sensitivity", text="NDOF Orbit Sensitivity")
+        sub.row().prop(inputs, "ndof_view_rotate_method", expand=True)
 
         row.separator()
 

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c	2012-09-28 12:01:21 UTC (rev 50943)
+++ trunk/blender/source/blender/editors/interface/resources.c	2012-09-28 12:37:14 UTC (rev 50944)
@@ -1982,7 +1982,10 @@
 	}
 	
 	if (U.ndof_orbit_sensitivity == 0.0f) {
-		U.ndof_orbit_sensitivity = 1.0f;
+		U.ndof_orbit_sensitivity = U.ndof_sensitivity;
+
+		if (!(U.flag & USER_TRACKBALL))
+			U.ndof_flag |= NDOF_TURNTABLE;
 	}
 	if (U.tweak_threshold == 0)
 		U.tweak_threshold = 10;

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2012-09-28 12:01:21 UTC (rev 50943)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2012-09-28 12:37:14 UTC (rev 50944)
@@ -3293,6 +3293,12 @@
 		{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
 		{0, NULL, 0, NULL, NULL}
 	};
+
+	static EnumPropertyItem ndof_view_rotation_items[] = {
+		{NDOF_TURNTABLE, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
+		{0, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
+		{0, NULL, 0, NULL, NULL}
+	};
 		
 	static EnumPropertyItem view_zoom_styles[] = {
 		{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
@@ -3384,9 +3390,10 @@
 	/* TODO: update description when fly-mode visuals are in place  ("projected position in fly mode")*/
 
 	/* 3D view */
-	prop = RNA_def_property(srna, "ndof_turntable", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_TURNTABLE);
-	RNA_def_property_ui_text(prop, "Turntable", "Turntable for ndof rotation");
+	prop = RNA_def_property(srna, "ndof_view_rotate_method", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, ndof_view_rotation_items);
+	RNA_def_property_ui_text(prop, "NDOF View Rotation", "Rotation style in the viewport");
 
 	/* 3D view: roll */
 	prop = RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);




More information about the Bf-blender-cvs mailing list