diff options
Diffstat (limited to 'source/blender/collada/CameraExporter.cpp')
-rw-r--r-- | source/blender/collada/CameraExporter.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index f8fa0fd55c0..a935f45c403 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -42,24 +42,25 @@ CamerasExporter::CamerasExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryCameras(sw){} template<class Functor> -void forEachCameraObjectInScene(Scene *sce, Functor &f) +void forEachCameraObjectInScene(Scene *sce, Functor &f, bool export_selected) { Base *base= (Base*) sce->base.first; while(base) { Object *ob = base->object; - if (ob->type == OB_CAMERA && ob->data) { + if (ob->type == OB_CAMERA && ob->data + && !(export_selected && !(ob->flag & SELECT))) { f(ob, sce); } base= base->next; } } -void CamerasExporter::exportCameras(Scene *sce) +void CamerasExporter::exportCameras(Scene *sce, bool export_selected) { openLibrary(); - forEachCameraObjectInScene(sce, *this); + forEachCameraObjectInScene(sce, *this, export_selected); closeLibrary(); } @@ -72,19 +73,19 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) if (cam->type == CAM_PERSP) { COLLADASW::PerspectiveOptic persp(mSW); - persp.setXFov(lens_to_angle(cam->lens)*(180.0f/M_PI)); - persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch)); - persp.setZFar(cam->clipend); - persp.setZNear(cam->clipsta); + persp.setXFov(lens_to_angle(cam->lens)*(180.0f/M_PI),"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"); COLLADASW::Camera ccam(mSW, &persp, cam_id, cam_name); addCamera(ccam); } else { COLLADASW::OrthographicOptic ortho(mSW); - ortho.setXMag(cam->ortho_scale); - ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch)); - ortho.setZFar(cam->clipend); - ortho.setZNear(cam->clipsta); + ortho.setXMag(cam->ortho_scale,"xmag"); + ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio"); + ortho.setZFar(cam->clipend , false , "zfar"); + ortho.setZNear(cam->clipsta, false , "znear"); COLLADASW::Camera ccam(mSW, &ortho, cam_id, cam_name); addCamera(ccam); } |