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:
authorCampbell Barton <ideasman42@gmail.com>2007-04-20 00:58:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-20 00:58:09 +0400
commit60b3268c32fbc8a908ffac76b45966da43373c3e (patch)
tree81128aa5ca19b962f0bd5538f87600dbce25b2cf /source/blender/src/view.c
parentf5a40315ca8c5f14623a09f8272417f65aaf6f6a (diff)
adding a python function for cleaning strings (for filenames and export names) BPySys.py - used fotr obj and fbx export.
view.c - missed one smoothview/camera. Brigg's hide object patch didnt change the object selection flag, other minor changes also.
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r--source/blender/src/view.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index bb7cf56821a..2193d17aa1c 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -1414,23 +1414,30 @@ void centerview() /* like a localview without local! */
new_dist = size;
- // correction for window aspect ratio
+ /* correction for window aspect ratio */
if(curarea->winy>2 && curarea->winx>2) {
size= (float)curarea->winx/(float)curarea->winy;
if(size<1.0) size= 1.0/size;
new_dist*= size;
}
- if(G.vd->persp>1) {
- G.vd->persp= 1;
- }
-
G.vd->cursor[0]= -new_ofs[0];
G.vd->cursor[1]= -new_ofs[1];
G.vd->cursor[2]= -new_ofs[2];
- smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
-
+ if (G.vd->persp==2 && G.vd->camera) {
+ float orig_lens= G.vd->lens;
+
+ G.vd->persp=1;
+ G.vd->dist= 0.0;
+ view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens);
+ smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens);
+ } else {
+ if(G.vd->persp>=2)
+ G.vd->persp= 1;
+
+ smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
+ }
scrarea_queue_winredraw(curarea);
BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);