diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-06 14:38:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-06 14:38:44 +0400 |
commit | e936c78251de5bafa99439803ab4fd2caa4df3b2 (patch) | |
tree | 51ccdc2efbab74903cb7b428619726832c3b1ab4 /source/blender/collada | |
parent | 735ab2b22d865570a4585e7088e66a45030ddf2d (diff) | |
parent | b18e661ffcd39b97ac0c8295d778a1cb31339ed8 (diff) |
svn merge ^/trunk/blender -r41503:41575
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/CameraExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index 6fa2c8763e0..fcb98cc7c32 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -71,7 +71,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) if (cam->type == CAM_PERSP) { COLLADASW::PerspectiveOptic persp(mSW); - persp.setXFov(RAD2DEGF(lens_to_angle(cam->lens)), "xfov"); + persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov"); persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio"); persp.setZFar(cam->clipend, false , "zfar"); persp.setZNear(cam->clipsta,false , "znear"); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 8d133979fa4..267aa925c74 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -54,7 +54,9 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "BKE_camera.h" #include "BKE_main.h" +#include "BKE_lamp.h" #include "BKE_library.h" #include "BKE_texture.h" #include "BKE_fcurve.h" @@ -814,7 +816,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) double aspect = camera->getAspectRatio().getValue(); double xfov = aspect*yfov; // xfov is in degrees, cam->lens is in millimiters - cam->lens = angle_to_lens(DEG2RADF(xfov)); + cam->lens = fov_to_focallength(DEG2RADF(xfov), cam->sensor_x); } break; } @@ -835,7 +837,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) { double x = camera->getXFov().getValue(); // x is in degrees, cam->lens is in millimiters - cam->lens = angle_to_lens(DEG2RADF(x)); + cam->lens = fov_to_focallength(DEG2RADF(x), cam->sensor_x); } break; } @@ -852,7 +854,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) { double yfov = camera->getYFov().getValue(); // yfov is in degrees, cam->lens is in millimiters - cam->lens = angle_to_lens(DEG2RADF(yfov)); + cam->lens = fov_to_focallength(DEG2RADF(yfov), cam->sensor_x); } break; } |