Fix T39397: Leaving leaving camera from quadview set ortho

This commit is contained in:
Campbell Barton 2014-03-25 14:21:50 +11:00
parent 9d244e0ad7
commit bd57ec686c
Notes: blender-bot 2023-02-14 10:55:35 +01:00
Referenced by issue #39397, Auto Perspective does not work the same in all quad view panels
4 changed files with 21 additions and 8 deletions

View File

@ -93,6 +93,8 @@ void ED_view3d_from_m4(float mat[4][4], float ofs[3], float quat[4], float *dist
void ED_view3d_from_object(struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
void ED_view3d_to_object(struct Object *ob, const float ofs[3], const float quat[4], const float dist);
void ED_view3d_lastview_store(struct RegionView3D *rv3d);
/* Depth buffer */
void ED_view3d_depth_update(struct ARegion *ar);
float ED_view3d_depth_read_cached(struct ViewContext *vc, int x, int y);

View File

@ -2848,6 +2848,10 @@ static void region_quadview_init_rv3d(ScrArea *sa, ARegion *ar,
{
RegionView3D *rv3d = ar->regiondata;
if (persp == RV3D_CAMOB) {
ED_view3d_lastview_store(rv3d);
}
rv3d->viewlock = viewlock;
rv3d->view = view;
rv3d->persp = persp;

View File

@ -3577,9 +3577,8 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
if (!rv3d->smooth_timer) {
/* store settings of current view before allowing overwriting with camera view
* only if we're not currently in a view transition */
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
rv3d->lview = rv3d->view;
rv3d->lpersp = rv3d->persp;
ED_view3d_lastview_store(rv3d);
}
#if 0
@ -4720,6 +4719,18 @@ void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], co
BKE_object_apply_mat4(ob, mat, true, true);
}
/**
* Use to store the last view, before entering camera view.
*/
void ED_view3d_lastview_store(RegionView3D *rv3d)
{
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
rv3d->lview = rv3d->view;
if (rv3d->persp != RV3D_CAMOB) {
rv3d->lpersp = rv3d->persp;
}
}
BGpic *ED_view3D_background_image_new(View3D *v3d)
{
BGpic *bgpic = MEM_callocN(sizeof(BGpic), "Background Image");

View File

@ -417,11 +417,7 @@ static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op))
ED_view3d_context_user_region(C, &v3d, &ar);
rv3d = ar->regiondata;
copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
rv3d->lview = rv3d->view;
if (rv3d->persp != RV3D_CAMOB) {
rv3d->lpersp = rv3d->persp;
}
ED_view3d_lastview_store(rv3d);
BKE_object_tfm_protected_backup(v3d->camera, &obtfm);