[Bf-blender-cvs] [a32ee63660f] master: Fix T72919: NDOF 'Free' orbit preference is ignored
Campbell Barton
noreply at git.blender.org
Wed Jan 8 04:33:05 CET 2020
Commit: a32ee63660ffd711ed2dab0d3e0b0c0efcd38044
Author: Campbell Barton
Date: Wed Jan 8 14:20:23 2020 +1100
Branches: master
https://developer.blender.org/rBa32ee63660ffd711ed2dab0d3e0b0c0efcd38044
Fix T72919: NDOF 'Free' orbit preference is ignored
Regression from 6288dbffb6c1f.
===================================================================
M source/blender/editors/space_view3d/view3d_edit.c
===================================================================
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) {
More information about the Bf-blender-cvs
mailing list