diff options
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 74732742555..2ac945f52b3 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -726,10 +726,15 @@ static enum eViewOpsOrbit viewops_orbit_mode(void) /** * Calculate the values for #ViewOpsData + * + * \param use_ensure_persp: When enabled run #view3d_ensure_persp this may switch out of + * camera view when orbiting or switch from ortho to perspective when auto-persp is enabled. + * Some operations don't require this (view zoom/pan or ndof where subtle rotation is common + * so we don't want it to trigger auto-perspective). */ static void viewops_data_create_ex( bContext *C, wmOperator *op, const wmEvent *event, - bool switch_from_camera, enum eViewOpsOrbit orbit_mode) + bool use_ensure_persp, enum eViewOpsOrbit orbit_mode) { ViewOpsData *vod = op->customdata; RegionView3D *rv3d = vod->rv3d; @@ -750,8 +755,7 @@ static void viewops_data_create_ex( vod->use_dyn_ofs = false; } - if (switch_from_camera) { - /* switch from camera view when: */ + if (use_ensure_persp) { if (view3d_ensure_persp(vod->v3d, vod->ar)) { /* If we're switching from camera view to the perspective one, * need to tag viewport update, so camera vuew and borders @@ -853,10 +857,10 @@ static void viewops_data_create_ex( rv3d->rflag |= RV3D_NAVIGATING; } -static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *event, bool switch_from_camera) +static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *event, bool use_ensure_persp) { enum eViewOpsOrbit orbit_mode = viewops_orbit_mode(); - viewops_data_create_ex(C, op, event, switch_from_camera, orbit_mode); + viewops_data_create_ex(C, op, event, use_ensure_persp, orbit_mode); } static void viewops_data_free(bContext *C, wmOperator *op) |