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:
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py4
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c8
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c35
4 files changed, 18 insertions, 31 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 72785fc2c15..dc2ff0d8544 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -970,13 +970,13 @@ class USERPREF_MT_ndof_settings(Menu):
layout.prop(input_prefs, "ndof_panx_invert_axis")
layout.prop(input_prefs, "ndof_pany_invert_axis")
layout.prop(input_prefs, "ndof_panz_invert_axis")
+ layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
layout.label(text="Zoom options")
layout.prop(input_prefs, "ndof_zoom_invert")
- layout.prop(input_prefs, "ndof_zoom_updown")
layout.separator()
- layout.label(text="Fly options")
+ layout.label(text="Fly/Walk options")
layout.prop(input_prefs, "ndof_fly_helicopter", icon='NDOF_FLY')
layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM')
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index dca007f83ec..ffc1c489d1e 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -793,7 +793,7 @@ typedef enum eNdof_Flag {
/* actually... users probably don't care about what the mode
* is called, just that it feels right */
/* zoom is up/down if this flag is set (otherwise forward/backward) */
- NDOF_ZOOM_UPDOWN = (1 << 7),
+ NDOF_PAN_YZ_SWAP_AXIS = (1 << 7),
NDOF_ZOOM_INVERT = (1 << 8),
NDOF_ROTATE_INVERT_AXIS = (1 << 9),
NDOF_TILT_INVERT_AXIS = (1 << 10),
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 704aff21c4d..54e1b0b78dd 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4046,10 +4046,10 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_range(prop, 0.25f, 40.0f);
RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting");
- prop = RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
- RNA_def_property_ui_text(prop, "Zoom = Up/Down",
- "Zoom using up/down on the device (otherwise forward/backward)");
+ prop = RNA_def_property(srna, "ndof_pan_yz_swap_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PAN_YZ_SWAP_AXIS);
+ RNA_def_property_ui_text(prop, "Y/Z Swap Axis",
+ "Pan using up/down on the device (otherwise forward/backward)");
prop = RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index e311144f522..47fdb37d403 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2855,33 +2855,20 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
{
wmNDOFMotionData *data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF");
- const float s = U.ndof_sensitivity;
+ const float ts = U.ndof_sensitivity;
const float rs = U.ndof_orbit_sensitivity;
- data->tx = s * ghost->tx;
+ mul_v3_v3fl(data->tvec, &ghost->tx, ts);
+ mul_v3_v3fl(data->rvec, &ghost->rx, rs);
- data->rx = rs * ghost->rx;
- data->ry = rs * ghost->ry;
- data->rz = rs * ghost->rz;
-
- if (U.ndof_flag & NDOF_ZOOM_UPDOWN) {
- /* rotate so Y is where Z was */
- data->ty = s * ghost->tz;
- data->tz = s * ghost->ty;
- /* maintain handed-ness? or just do what feels right? */
-
- /* should this affect rotation also?
- * initial guess is 'yes', but get user feedback immediately!
- */
-#if 0
- /* after turning this on, my guess becomes 'no' */
- data->ry = s * ghost->rz;
- data->rz = s * ghost->ry;
-#endif
- }
- else {
- data->ty = s * ghost->ty;
- data->tz = s * ghost->tz;
+ /**
+ * \note
+ * - optionally swap Y/Z.
+ * - maintain handed-ness? or just do what feels right? not for now.
+ * - after testing seems best not to apply this to rotation.
+ */
+ if (U.ndof_flag & NDOF_PAN_YZ_SWAP_AXIS) {
+ SWAP(float, data->tvec[1], data->tvec[2]);
}
data->dt = ghost->dt;