[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40556] trunk/blender/source/blender/ editors/space_view3d/view3d_fly.c: workaround/fix for [#28379] Shift+F problem when using Ortho Camera
Campbell Barton
ideasman42 at gmail.com
Mon Sep 26 10:33:52 CEST 2011
Revision: 40556
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40556
Author: campbellbarton
Date: 2011-09-26 08:33:51 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_fly.c 2011-09-26 07:54:30 UTC (rev 40555)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_fly.c 2011-09-26 08:33:51 UTC (rev 40556)
@@ -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 @@
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 @@
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 @@
/*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 */
More information about the Bf-blender-cvs
mailing list