From 3eaf2b2e50c94a594c0ae2394e9be74839dcbabe Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Dec 2023 13:12:56 +1100 Subject: [PATCH] Fix #115253: NDOF zoom-speed depends on selected objects Recent refactor to viewport navigation caused a regression where "Orbit Around Selected" logic to impacted "Free" NDOF navigation logic. Resolve by disabling orbit around selection with "Free" navigation. --- source/blender/editors/space_view3d/view3d_navigate.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/editors/space_view3d/view3d_navigate.cc b/source/blender/editors/space_view3d/view3d_navigate.cc index 0f41cfaaa09..d7f5d192627 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.cc +++ b/source/blender/editors/space_view3d/view3d_navigate.cc @@ -253,6 +253,14 @@ void ViewOpsData::init_navigation(bContext *C, &ViewOpsType_ndof_all)) { calc_rv3d_dist = false; + + /* When using "Free" NDOF navigation, ignore "Orbit Around Selected" preference. + * Logically it doesn't make sense to use the selection as a pivot when the first-person + * navigation pivots from the view-point. This also interferes with zoom-speed, + * causing zoom-speed scale based on the distance to the selection center, see: #115253. */ + if ((U.ndof_flag & NDOF_MODE_ORBIT) == 0) { + viewops_flag &= ~VIEWOPS_FLAG_ORBIT_SELECT; + } } #endif