Docs: rename var and comment how it's used
switch_from_camera wasn't right since it was used for auto-perspective.
This commit is contained in:
parent
0b5b464e82
commit
e476298084
Notes:
blender-bot
2023-02-14 06:39:26 +01:00
Referenced by issue #52488, Linux - Audio Mixdown - flac audio isnt created correctly
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue