diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-28 16:37:14 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-28 16:37:14 +0400 |
commit | 4cf06b97ddcd0204a35969b0521154bcdd7a9cd8 (patch) | |
tree | 6258b49a2fb0706836799b7ef24b047c17144167 /source | |
parent | cd560a1e6acd5ec9353a7f75ffd2310352435c88 (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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/resources.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 13 |
2 files changed, 14 insertions, 4 deletions
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); |