Commit: a04c132a7efe09846aad1b68e0f604e9a3ff3156
Author: Campbell Barton
Date:   Fri Feb 28 22:07:53 2014 +1100
https://developer.blender.org/rBa04c132a7efe09846aad1b68e0f604e9a3ff3156

NDOF: minor tweaks based on feedback.

- invert Y axis when swap YZ is enabled.
- allow rotating when not in ortho mode.

===================================================================

M       source/blender/editors/space_view3d/view3d_edit.c
M       source/blender/windowmanager/intern/wm_event_system.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c 
b/source/blender/editors/space_view3d/view3d_edit.c
index e8b08f3..cf593a6 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1548,7 +1548,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator 
*op, const wmEvent *ev
                if (ndof->progress == P_FINISHING) {
                        /* pass */
                }
-               else if (RV3D_VIEW_IS_AXIS(rv3d->view)) {
+               else if ((rv3d->persp == RV3D_ORTHO) && 
RV3D_VIEW_IS_AXIS(rv3d->view)) {
                        /* if we can't rotate, fallback to translate (locked 
axis views) */
                        const bool has_translate = NDOF_HAS_TRANSLATE;
                        const bool has_zoom = (ndof->tvec[2] != 0.0f) && 
ED_view3d_offset_lock_check(v3d, rv3d);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c 
b/source/blender/windowmanager/intern/wm_event_system.c
index 6a70be3..ecf56bc 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2883,14 +2883,11 @@ static void attach_ndof_data(wmEvent *event, const 
GHOST_TEventNDOFMotionData *g
        mul_v3_v3fl(data->tvec, &ghost->tx, ts);
        mul_v3_v3fl(data->rvec, &ghost->rx, rs);
 
-       /**
-        * \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]);
+               float t;
+               t =  data->tvec[1];
+               data->tvec[1] = -data->tvec[2];
+               data->tvec[2] = t;
        }
 
        data->dt = ghost->dt;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to