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>2011-09-26 12:33:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-26 12:33:51 +0400
commitb3d21088aa924a8930b6577d4f9e9639f7779371 (patch)
tree1e7aaf7019a7a5ebb0501c733504e503ff3dc165 /source/blender/editors/space_view3d/view3d_fly.c
parentaeafb960b198788b0836e16a70622a4c8863d268 (diff)
workaround/fix for [#28379] Shift+F problem when using Ortho Camera
temp switch to perspective mode since fly mode doesnt really make sense for otho view.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_fly.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index 1ce246a5542..02a6cee5140 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -35,6 +35,7 @@
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
+#include "DNA_camera_types.h"
#include "MEM_guardedalloc.h"
@@ -199,6 +200,10 @@ typedef struct FlyInfo {
float rot_backup[4]; /* backup the views quat incase the user cancels flying in non camera mode. (quat for view, eul for camera) */
short persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
+ short is_ortho_cam; /* are we flying an ortho camera in perspective view,
+ * which was originall in ortho view?
+ * could probably figure it out but better be explicit */
+
void *obtfm; /* backup the objects transform */
/* compare between last state */
@@ -330,6 +335,17 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
fly->persp_backup= fly->rv3d->persp;
fly->dist_backup= fly->rv3d->dist;
+
+ /* check for flying ortho camera - which we cant support well
+ * we _could_ also check for an ortho camera but this is easier */
+ if( (fly->rv3d->persp == RV3D_CAMOB) &&
+ (fly->v3d->camera != NULL) &&
+ (fly->rv3d->is_persp == FALSE))
+ {
+ ((Camera *)fly->v3d->camera->data)->type= CAM_PERSP;
+ fly->is_ortho_cam= TRUE;
+ }
+
if (fly->rv3d->persp==RV3D_CAMOB) {
Object *ob_back;
if ((U.uiflag & USER_CAM_LOCK_NO_PARENT)==0 && (fly->root_parent=fly->v3d->camera->parent)) {
@@ -433,6 +449,10 @@ static int flyEnd(bContext *C, FlyInfo *fly)
/*Done with correcting for the dist */
}
+ if(fly->is_ortho_cam) {
+ ((Camera *)fly->v3d->camera->data)->type= CAM_ORTHO;
+ }
+
rv3d->rflag &= ~RV3D_NAVIGATING;
//XXX2.5 BIF_view3d_previewrender_signal(fly->sa, PR_DBASE|PR_DISPRECT); /* not working at the moment not sure why */