diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-28 07:06:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-28 07:09:27 +0300 |
commit | 6288dbffb6c1f98a04f7c25ed96caa963e5c8819 (patch) | |
tree | 8417570a7730115e45ff2e133106fdb1e9abd611 | |
parent | 4659fa547166b589cc8e3aef4b8dc699d95547df (diff) |
NDOF: support panning when orbiting
Also make orbit the default rotation mode.
Based on feedback from T67579, this seems one of the main
pain points users are experiencing.
-rw-r--r-- | release/datafiles/userdef/userdef_default.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/release/datafiles/userdef/userdef_default.c b/release/datafiles/userdef/userdef_default.c index d8b87480f29..93ddc43cf15 100644 --- a/release/datafiles/userdef/userdef_default.c +++ b/release/datafiles/userdef/userdef_default.c @@ -153,7 +153,8 @@ const UserDef U_default = { .ndof_sensitivity = 1.0, .ndof_orbit_sensitivity = 1.0, .ndof_deadzone = 0.1, - .ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE), + .ndof_flag = (NDOF_MODE_ORBIT | NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | + NDOF_SHOULD_ROTATE), .ogl_multisamples = 0, .image_draw_method = IMAGE_DRAW_METHOD_AUTO, .glalphaclip = 0.004, diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 3ad194a5d2b..67f23012d10 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1432,11 +1432,18 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev } } else if ((U.ndof_flag & NDOF_MODE_ORBIT) || ED_view3d_offset_lock_check(v3d, rv3d)) { + /* Note: based on feedback from T67579, users want to have pan and orbit enabled at once. + * It's arguable that orbit shouldn't pan (since we have a pan only operator), + * so if there are users who like to separate orbit/pan operations - it can be a preference. + * + * Also, the 'orbit' and 'free' blocks of code are now very similar. + * these could be merged, keep separate until design issues are sorted out - Campbell. */ const bool has_rotation = NDOF_HAS_ROTATE; + const bool has_translate = !is_zero_v2(ndof->tvec) && NDOF_HAS_TRANSLATE; const bool has_zoom = (ndof->tvec[2] != 0.0f); - if (has_zoom) { - view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, false, has_zoom); + if (has_translate || has_zoom) { + view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom); xform_flag |= HAS_TRANSLATE; } |