From 06cb460cd76f4ca5837246f66ed9a3d399db3359 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 May 2018 10:34:01 +0200 Subject: 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. --- source/blender/editors/space_view3d/view3d_edit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); -- cgit v1.2.3