diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-25 07:21:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-25 08:14:34 +0400 |
commit | bd57ec686c7ec00a9a01e30f32bbcfd3c21a41fb (patch) | |
tree | 45bd939a8d95448c055e653091736f1eeeb063f5 | |
parent | 9d244e0ad7cb523e58ba76758da28655a942ac09 (diff) |
Fix T39397: Leaving leaving camera from quadview set ortho
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 6 |
4 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 65d31da2347..d0200bbe01a 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -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); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 49f883ea6a4..40e297d88e8 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4e21a318d85..b60e2e42c7d 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -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"); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 22f16091066..102d8c77366 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -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); |