Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-23 19:05:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-09-04 13:59:00 +0300
commitbb92bb53299a2b0037df5007c653a9889c8e9362 (patch)
treed4326118426f7a3dd6878ec0bc409517d9d8901d
parent7997646c2d89478d61dc42c95a48d88660d56e21 (diff)
Docs: rename var and comment how it's used
switch_from_camera wasn't right since it was used for auto-perspective.
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c14
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)