From a65ef6a1df8fc22105575013128eecbb071df5e4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Nov 2013 12:53:40 +1100 Subject: Fix T37586: Auto-perspective was changing to perspective while orbiting --- source/blender/editors/space_view3d/view3d_edit.c | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index b49abaf55ad..c6594680217 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -992,15 +992,15 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* switch from camera view when: */ if (vod->rv3d->persp != RV3D_PERSP) { - - if (U.uiflag & USER_AUTOPERSP) { + if (vod->rv3d->persp == RV3D_CAMOB) { + const short lpersp = (U.uiflag & USER_AUTOPERSP) ? RV3D_PERSP : vod->rv3d->lpersp; + view3d_persp_switch_from_camera(vod->v3d, vod->rv3d, lpersp); + } + else if ((U.uiflag & USER_AUTOPERSP) && RV3D_VIEW_IS_AXIS(vod->rv3d->view)) { if (!ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) { vod->rv3d->persp = RV3D_PERSP; } } - else if (vod->rv3d->persp == RV3D_CAMOB) { - view3d_persp_switch_from_camera(vod->v3d, vod->rv3d, vod->rv3d->lpersp); - } ED_region_tag_redraw(vod->ar); } @@ -3344,20 +3344,19 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar, return; } - if (rv3d->persp == RV3D_CAMOB && v3d->camera) { - - if (U.uiflag & USER_AUTOPERSP) rv3d->persp = view ? RV3D_ORTHO : RV3D_PERSP; - else if (rv3d->persp == RV3D_CAMOB) rv3d->persp = perspo; + if (U.uiflag & USER_AUTOPERSP) { + rv3d->persp = RV3D_VIEW_IS_AXIS(view) ? RV3D_ORTHO : perspo; + } + else if (rv3d->persp == RV3D_CAMOB) { + rv3d->persp = perspo; + } + if (rv3d->persp == RV3D_CAMOB && v3d->camera) { ED_view3d_smooth_view(C, v3d, ar, v3d->camera, NULL, rv3d->ofs, new_quat, NULL, NULL, smooth_viewtx); } else { - - if (U.uiflag & USER_AUTOPERSP) rv3d->persp = view ? RV3D_ORTHO : RV3D_PERSP; - else if (rv3d->persp == RV3D_CAMOB) rv3d->persp = perspo; - ED_view3d_smooth_view(C, v3d, ar, NULL, NULL, NULL, new_quat, NULL, NULL, smooth_viewtx); -- cgit v1.2.3