From 391c3848b1326db1c29fc5c5f791d732d7d282a3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 23 Feb 2022 21:25:46 +1100 Subject: NDOF: make camera view/pan behavior optional User request since adding this option in: 51975b89edfcc02131f1f8248e1b3442ea2778fa When disabled, use the previous behavior when orbiting a camera view. --- .../blender/editors/space_view3d/view3d_navigate_ndof.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_navigate_ndof.c b/source/blender/editors/space_view3d/view3d_navigate_ndof.c index 67b48154e8c..6b77f464773 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_ndof.c +++ b/source/blender/editors/space_view3d/view3d_navigate_ndof.c @@ -500,9 +500,11 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev return OPERATOR_CANCELLED; } - const int camera_retval = view3d_ndof_cameraview_pan_zoom(C, event); - if (camera_retval != OPERATOR_PASS_THROUGH) { - return camera_retval; + if (U.ndof_flag & NDOF_CAMERA_PAN_ZOOM) { + const int camera_retval = view3d_ndof_cameraview_pan_zoom(C, event); + if (camera_retval != OPERATOR_PASS_THROUGH) { + return camera_retval; + } } const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -619,9 +621,11 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *e return OPERATOR_CANCELLED; } - const int camera_retval = view3d_ndof_cameraview_pan_zoom(C, event); - if (camera_retval != OPERATOR_PASS_THROUGH) { - return camera_retval; + if (U.ndof_flag & NDOF_CAMERA_PAN_ZOOM) { + const int camera_retval = view3d_ndof_cameraview_pan_zoom(C, event); + if (camera_retval != OPERATOR_PASS_THROUGH) { + return camera_retval; + } } const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); -- cgit v1.2.3