[Bf-blender-cvs] [6004e9d62ba] blender-v3.3-release: Fix T100953: Zooming with NDOF is inverted in the camera view

Campbell Barton noreply at git.blender.org
Wed Oct 26 10:55:06 CEST 2022


Commit: 6004e9d62ba5c8c6935f5d146f05e148528f042a
Author: Campbell Barton
Date:   Fri Oct 7 17:44:17 2022 +1100
Branches: blender-v3.3-release
https://developer.blender.org/rB6004e9d62ba5c8c6935f5d146f05e148528f042a

Fix T100953: Zooming with NDOF is inverted in the camera view

Use convention for applying zoom in other 2D views.

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

M	source/blender/editors/space_view3d/view3d_navigate_ndof.c

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

diff --git a/source/blender/editors/space_view3d/view3d_navigate_ndof.c b/source/blender/editors/space_view3d/view3d_navigate_ndof.c
index 88abf602c26..af2a304784e 100644
--- a/source/blender/editors/space_view3d/view3d_navigate_ndof.c
+++ b/source/blender/editors/space_view3d/view3d_navigate_ndof.c
@@ -376,6 +376,9 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
   float pan_vec[3];
   WM_event_ndof_pan_get(ndof, pan_vec, true);
 
+  mul_v2_fl(pan_vec, ndof->dt);
+  pan_vec[2] *= -ndof->dt;
+
   /* NOTE(@campbellbarton): In principle rotating could pass through to regular
    * non-camera NDOF behavior (exiting the camera-view and rotating).
    * Disabled this block since in practice it's difficult to control NDOF devices
@@ -390,7 +393,7 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
   bool changed = false;
 
   if (has_translate) {
-    const float speed = ndof->dt * NDOF_PIXELS_PER_SECOND;
+    const float speed = NDOF_PIXELS_PER_SECOND;
     float event_ofs[2] = {pan_vec[0] * speed, pan_vec[1] * speed};
     if (ED_view3d_camera_view_pan(region, event_ofs)) {
       changed = true;
@@ -398,7 +401,7 @@ static int view3d_ndof_cameraview_pan_zoom(bContext *C, const wmEvent *event)
   }
 
   if (has_zoom) {
-    const float scale = 1.0f + (ndof->dt * pan_vec[2]);
+    const float scale = 1.0f + pan_vec[2];
     if (ED_view3d_camera_view_zoom_scale(rv3d, scale)) {
       changed = true;
     }



More information about the Bf-blender-cvs mailing list