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.
This commit is contained in:
Brecht Van Lommel 2012-09-28 12:37:14 +00:00
parent cd560a1e6a
commit 4cf06b97dd
3 changed files with 17 additions and 5 deletions

@ -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()

@ -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;

@ -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);