Index: release/scripts/startup/bl_ui/space_userpref.py =================================================================== --- release/scripts/startup/bl_ui/space_userpref.py (Revision 39769) +++ release/scripts/startup/bl_ui/space_userpref.py (Arbeitskopie) @@ -773,7 +773,12 @@ layout.separator() layout.label(text="orbit options") - layout.prop(input_prefs, "ndof_orbit_invert_axes") + if input_prefs.view_rotate_method == 'TRACKBALL': + layout.prop(input_prefs, "ndof_roll_invert_axis") + layout.prop(input_prefs, "ndof_tilt_invert_axis") + layout.prop(input_prefs, "ndof_rotate_invert_axis") + else: + layout.prop(input_prefs, "ndof_orbit_invert_axes") layout.separator() layout.label(text="fly options") Index: source/blender/editors/space_view3d/view3d_edit.c =================================================================== --- source/blender/editors/space_view3d/view3d_edit.c (Revision 39769) +++ source/blender/editors/space_view3d/view3d_edit.c (Arbeitskopie) @@ -1017,17 +1017,25 @@ if (has_rotation) { - const int invert = U.ndof_flag & NDOF_ORBIT_INVERT_AXES; - rv3d->view = RV3D_VIEW_USER; if (U.flag & USER_TRACKBALL) { + const int invert_roll = U.ndof_flag & NDOF_ROLL_INVERT_AXIS; + const int invert_tilt = U.ndof_flag & NDOF_TILT_INVERT_AXIS; + const int invert_rot = U.ndof_flag & NDOF_ROTATE_INVERT_AXIS; + float rot[4]; float axis[3]; float angle = rot_sensitivity * ndof_to_axis_angle(ndof, axis); + + if (invert_roll) + axis[2] = -axis[2]; + + if (invert_tilt) + axis[0] = -axis[0]; - if (invert) - angle = -angle; + if (invert_rot) + axis[1] = -axis[1]; // transform rotation axis from view to world coordinates mul_qt_v3(view_inv, axis); @@ -1042,6 +1050,8 @@ mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, rot); } else { /* turntable view code by John Aughey, adapted for 3D mouse by [mce] */ + const int invert = U.ndof_flag & NDOF_ORBIT_INVERT_AXES; + float angle, rot[4]; float xvec[3] = {1,0,0}; Index: source/blender/makesdna/DNA_userdef_types.h =================================================================== --- source/blender/makesdna/DNA_userdef_types.h (Revision 39769) +++ source/blender/makesdna/DNA_userdef_types.h (Arbeitskopie) @@ -600,6 +600,9 @@ */ /* actually... users probably don't care about what the mode is called, just that it feels right */ +#define NDOF_ROTATE_INVERT_AXIS (1 << 3) +#define NDOF_TILT_INVERT_AXIS (1 << 4) +#define NDOF_ROLL_INVERT_AXIS (1 << 5) #define NDOF_ORBIT_INVERT_AXES (1 << 6) /* zoom is up/down if this flag is set (otherwise forward/backward) */ #define NDOF_ZOOM_UPDOWN (1 << 7) Index: source/blender/makesrna/intern/rna_userdef.c =================================================================== --- source/blender/makesrna/intern/rna_userdef.c (Revision 39769) +++ source/blender/makesrna/intern/rna_userdef.c (Arbeitskopie) @@ -2771,6 +2771,21 @@ RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed"); /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */ + /* 3D view: roll */ + prop= RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROLL_INVERT_AXIS); + RNA_def_property_ui_text(prop, "Invert roll Axis", "Invert roll axis"); + + /* 3D view: tilt */ + prop= RNA_def_property(srna, "ndof_tilt_invert_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_TILT_INVERT_AXIS); + RNA_def_property_ui_text(prop, "Invert tilt Axis", "Invert tilt axis"); + + /* 3D view: rotate */ + prop= RNA_def_property(srna, "ndof_rotate_invert_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROTATE_INVERT_AXIS); + RNA_def_property_ui_text(prop, "Invert rotation Axis", "Invert rotation axis"); + /* 3D view: fly */ prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);