diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-08 06:20:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-08 06:30:47 +0300 |
commit | a32ee63660ffd711ed2dab0d3e0b0c0efcd38044 (patch) | |
tree | e0080ad40e2f90ec438bf793ae98d37c7055dfd7 /source/blender/editors | |
parent | 0e37045f32f35ff2264838fbaadd48ca7f2a0117 (diff) |
Fix T72919: NDOF 'Free' orbit preference is ignored
Regression from 6288dbffb6c1f.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index d40f79cea3f..45388ce3691 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1448,10 +1448,20 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev const bool is_orbit_around_pivot = (U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d); const bool has_rotation = ndof_has_rotate(ndof, rv3d); - const bool has_translate = !is_zero_v2(ndof->tvec) && ndof_has_translate(ndof, v3d, rv3d); - const bool has_zoom = (ndof->tvec[2] != 0.0f); + bool has_translate, has_zoom; - /* Rotation first because dynamic offset resets offset otherwise (and disasbles panning). */ + if (is_orbit_around_pivot) { + /* Orbit preference or forced lock (Z zooms). */ + has_translate = !is_zero_v2(ndof->tvec) && ndof_has_translate(ndof, v3d, rv3d); + has_zoom = (ndof->tvec[2] != 0.0f); + } + else { + /* Free preference (Z translates). */ + has_translate = ndof_has_translate(ndof, v3d, rv3d); + has_zoom = false; + } + + /* Rotation first because dynamic offset resets offset otherwise (and disables panning). */ if (has_rotation) { const float dist_backup = rv3d->dist; if (!is_orbit_around_pivot) { |