Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-09-28 16:37:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-09-28 16:37:14 +0400
commit4cf06b97ddcd0204a35969b0521154bcdd7a9cd8 (patch)
tree6258b49a2fb0706836799b7ef24b047c17144167
parentcd560a1e6acd5ec9353a7f75ffd2310352435c88 (diff)
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.
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py4
-rw-r--r--source/blender/editors/interface/resources.c5
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c13
3 files changed, 17 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index b0b587056b1..444e9349e9f 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -866,7 +866,7 @@ class USERPREF_MT_ndof_settings(Menu):
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 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
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()
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 502944f73ed..1efb24341b8 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1982,7 +1982,10 @@ void init_userdef_do_versions(void)
}
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;
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4f537b083b9..9c989121aa4 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3293,6 +3293,12 @@ static void rna_def_userdef_input(BlenderRNA *brna)
{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 @@ static void rna_def_userdef_input(BlenderRNA *brna)
/* 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);