Commit: 06cb460cd76f4ca5837246f66ed9a3d399db3359
Author: Campbell Barton
Date:   Sun May 27 10:34:01 2018 +0200
Branches: master
https://developer.blender.org/rB06cb460cd76f4ca5837246f66ed9a3d399db3359

3D View: minor change to NDOF view orbit

This change is needed for 2.8, where the NULL check isn't a reliable way
of testing if dynamic offset is needed.

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

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

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

diff --git a/source/blender/editors/space_view3d/view3d_edit.c 
b/source/blender/editors/space_view3d/view3d_edit.c
index 199800df539..8573bb3457a 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1098,7 +1098,7 @@ static void view3d_ndof_pan_zoom(
 static void view3d_ndof_orbit(
         const struct wmNDOFMotionData *ndof, ScrArea *sa, ARegion *ar,
         /* optional, can be NULL*/
-        ViewOpsData *vod)
+        ViewOpsData *vod, const bool apply_dyn_ofs)
 {
        View3D *v3d = sa->spacedata.first;
        RegionView3D *rv3d = ar->regiondata;
@@ -1161,7 +1161,7 @@ static void view3d_ndof_orbit(
                mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, quat);
        }
 
-       if (vod) {
+       if (apply_dyn_ofs) {
                viewrotate_apply_dyn_ofs(vod, rv3d->viewquat);
        }
 }
@@ -1329,7 +1329,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, 
const wmEvent *event)
                        }
 
                        if (has_rotation) {
-                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod);
+                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, 
true);
                        }
                }
 
@@ -1410,7 +1410,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator 
*op, const wmEvent *ev
                        }
 
                        if (has_rotation) {
-                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod);
+                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, vod, 
true);
                        }
                }
                else {  /* free/explore (like fly mode) */
@@ -1428,7 +1428,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator 
*op, const wmEvent *ev
                        ED_view3d_distance_set(rv3d, 0.0f);
 
                        if (has_rotation) {
-                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, NULL);
+                               view3d_ndof_orbit(ndof, vod->sa, vod->ar, NULL, 
false);
                        }
 
                        ED_view3d_distance_set(rv3d, dist_backup);

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

Reply via email to