3D View: add missing calls to force-finish smooth view
Operations that act on the viewport should finish smooth-view first.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "ED_undo.hh"
|
||||
|
||||
#include "view3d_intern.hh" /* own include */
|
||||
#include "view3d_navigate.hh"
|
||||
|
||||
/* test for unlocked camera view in quad view */
|
||||
static bool view3d_camera_user_poll(bContext *C)
|
||||
@@ -445,6 +446,9 @@ static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator * /*op*/)
|
||||
/* no nullptr check is needed, poll checks */
|
||||
ED_view3d_context_user_region(C, &v3d, ®ion);
|
||||
|
||||
/* NOTE: don't call #ED_view3d_smooth_view_force_finish as the camera zoom
|
||||
* isn't controlled by smooth-view, there is no need to "finish". */
|
||||
|
||||
view3d_set_1_to_1_viewborder(scene, depsgraph, region, v3d);
|
||||
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
|
||||
@@ -475,12 +479,14 @@ void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot)
|
||||
|
||||
static int viewpersportho_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
View3D *v3d_dummy;
|
||||
View3D *v3d;
|
||||
ARegion *region;
|
||||
RegionView3D *rv3d;
|
||||
|
||||
/* no nullptr check is needed, poll checks */
|
||||
ED_view3d_context_user_region(C, &v3d_dummy, ®ion);
|
||||
ED_view3d_context_user_region(C, &v3d, ®ion);
|
||||
ED_view3d_smooth_view_force_finish(C, v3d, region);
|
||||
|
||||
rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
||||
/* Could add a separate lock flag for locking persp. */
|
||||
|
||||
@@ -63,6 +63,8 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
|
||||
/* no nullptr check is needed, poll checks */
|
||||
ED_view3d_context_user_region(C, &vod.v3d, &vod.region);
|
||||
vod.rv3d = static_cast<RegionView3D *>(vod.region->regiondata);
|
||||
|
||||
ED_view3d_smooth_view_force_finish(C, vod.v3d, vod.region);
|
||||
}
|
||||
|
||||
if ((RV3D_LOCK_FLAGS(vod.rv3d) & RV3D_LOCK_ROTATION) && (view_opposite == RV3D_VIEW_USER)) {
|
||||
|
||||
@@ -182,6 +182,8 @@ static int viewroll_exec(bContext *C, wmOperator *op)
|
||||
vod->rv3d = static_cast<RegionView3D *>(vod->region->regiondata);
|
||||
}
|
||||
|
||||
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->region);
|
||||
|
||||
const bool is_camera_lock = ED_view3d_camera_lock_check(vod->v3d, vod->rv3d);
|
||||
if (vod->rv3d->persp == RV3D_CAMOB && !is_camera_lock) {
|
||||
viewops_data_free(C, vod);
|
||||
|
||||
@@ -64,6 +64,8 @@ static int view3d_camera_to_view_exec(bContext *C, wmOperator * /*op*/)
|
||||
ED_view3d_context_user_region(C, &v3d, ®ion);
|
||||
rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
||||
ED_view3d_smooth_view_force_finish(C, v3d, region);
|
||||
|
||||
ED_view3d_lastview_store(rv3d);
|
||||
|
||||
BKE_object_tfm_protected_backup(v3d->camera, &obtfm);
|
||||
@@ -234,6 +236,8 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op)
|
||||
ED_view3d_context_user_region(C, &v3d, ®ion);
|
||||
rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
||||
ED_view3d_smooth_view_force_finish(C, v3d, region);
|
||||
|
||||
if (ob) {
|
||||
Object *camera_old = (rv3d->persp == RV3D_CAMOB) ? V3D_CAMERA_SCENE(scene, v3d) : nullptr;
|
||||
rv3d->persp = RV3D_CAMOB;
|
||||
|
||||
Reference in New Issue
Block a user