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:
authorJoshua Leung <aligorith@gmail.com>2008-09-29 12:11:26 +0400
committerJoshua Leung <aligorith@gmail.com>2008-09-29 12:11:26 +0400
commite17c2c51bf3d1d8e47f423c4363a51f3b1602469 (patch)
tree6f0d3747947a95b3f5ebcbcb6fcf554b6fb5a860 /source/blender/src/toets.c
parent638c51ba7d54b7a815c745d5f383bcbed6d4d1d1 (diff)
Bugfix:
Recoded pidhash's recent Pad0 (Lastview) commits (r.16802 and r.16810). It was causing major issues with Ortho perspective + rotating the view with the MMB. Setting G.vd->view to -1 was not such a valid way to do so (and also, this didn't play nicely with smoothview). This feature should now work correctly, though there are still one or two places where it doesn't always seem totally correct yet. The basic idea of this feature, is that after going into camera mode (Pad0), pressing Pad0 again lets you go back to the view as you had it before entering camera mode.
Diffstat (limited to 'source/blender/src/toets.c')
-rw-r--r--source/blender/src/toets.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index 90749268a58..e40a2f5c044 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -289,9 +289,22 @@ void persptoetsen(unsigned short event)
if(G.vd->persp==V3D_PERSP) G.vd->persp=V3D_ORTHO;
else G.vd->persp=V3D_PERSP;
}
- G.vd->lpersp = G.vd->persp;
}
else if(event==PAD0) {
+ /* lastview - */
+ if(G.vd->lastview_set==0) {
+ /* store settings of current view before allowing overwriting with camera view */
+ QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
+ G.vd->lview= G.vd->view;
+ G.vd->lpersp= G.vd->persp;
+ G.vd->lastview_set= 1;
+ }
+ else if(G.vd->lastview_set) {
+ /* return to settings of last view */
+ axis_set_view(G.vd->lviewquat[0], G.vd->lviewquat[1], G.vd->lviewquat[2], G.vd->lviewquat[3], G.vd->lview, G.vd->lpersp);
+ G.vd->lastview_set= 0;
+ }
+
if(G.qual==LR_ALTKEY) {
if(oldcamera && is_an_active_object(oldcamera)) {
G.vd->camera= oldcamera;
@@ -314,18 +327,12 @@ void persptoetsen(unsigned short event)
handle_view3d_lock();
}
}
+
if(G.vd->camera==0) {
G.vd->camera= scene_find_camera(G.scene);
handle_view3d_lock();
}
- if(!G.vd->view) {
- QUATCOPY(G.vd->viewquat, G.vd->lviewquat);
- G.vd->persp = G.vd->lpersp;
- }
- else {
- QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
- G.vd->lpersp = G.vd->persp;
- }
+
if(G.vd->camera && (G.vd->camera != act_cam_orig)) {
G.vd->persp= V3D_CAMOB;
G.vd->view= 0;
@@ -350,8 +357,6 @@ void persptoetsen(unsigned short event)
VECCOPY(G.vd->ofs, orig_ofs);
G.vd->lens = orig_lens;
}
-
-
}
}
else if(event==PAD9) {
@@ -370,11 +375,6 @@ void persptoetsen(unsigned short event)
q1[1]= q1[2]= 0.0;
q1[3]= si;
QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
- G.vd->lpersp = G.vd->persp;
-
- G.vd->view= 0;
}
if(event==PAD2 || event==PAD8) {
/* horizontal axis */
@@ -389,11 +389,6 @@ void persptoetsen(unsigned short event)
q1[2]*= si;
q1[3]*= si;
QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
- G.vd->lpersp = G.vd->persp;
-
- G.vd->view= 0;
}
}