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.
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user