diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-07 20:56:56 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-07 20:56:56 +0400 |
commit | be918954bd71ed801652039c6f4a0c98094bdc77 (patch) | |
tree | 9a36c6ffe7540d277ac4ef8294149152333dfa4e /source/blender/collada/AnimationImporter.cpp | |
parent | c57ac39f7f0629a1ec73654664202637a07cb770 (diff) |
Fixed Camera Ortho scale animation import
Diffstat (limited to 'source/blender/collada/AnimationImporter.cpp')
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index a70e3cd8abd..ecd174891ae 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -856,7 +856,7 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node , } } - if ( ((animType & CAMERA_XFOV) != 0) ) + if ( ((animType & CAMERA_XFOV) != 0) || (animType & CAMERA_XMAG) != 0 ) { Camera * camera = (Camera*) ob->data; @@ -875,6 +875,13 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node , const COLLADAFW::UniqueId& listid = xfov->getAnimationList(); Assign_float_animations( listid ,AnimCurves, "lens"); } + + else if ((animType & CAMERA_XMAG) != 0 ) + { + const COLLADAFW::AnimatableFloat *xmag = &(camera->getXMag()); + const COLLADAFW::UniqueId& listid = xmag->getAnimationList(); + Assign_float_animations( listid ,AnimCurves, "ortho_scale"); + } } } } @@ -932,17 +939,23 @@ int AnimationImporter::get_animation_type ( const COLLADAFW::Node * node , for (unsigned int i = 0; i < nodeCameras.getCount(); i++) { const COLLADAFW::Camera *camera = (COLLADAFW::Camera *) FW_object_map[nodeCameras[i]->getInstanciatedObjectId()]; - const COLLADAFW::AnimatableFloat *xfov = &(camera->getXFov()); - const COLLADAFW::UniqueId& xfov_listid = xfov ->getAnimationList(); - - if (animlist_map.find(xfov_listid) != animlist_map.end()) + if ( camera->getCameraType() == COLLADAFW::Camera::PERSPECTIVE ) + { + const COLLADAFW::AnimatableFloat *xfov = &(camera->getXFov()); + const COLLADAFW::UniqueId& xfov_listid = xfov ->getAnimationList(); + if (animlist_map.find(xfov_listid) != animlist_map.end()) type = type|CAMERA_XFOV; - - + } + else + { + const COLLADAFW::AnimatableFloat *xmag = &(camera->getXMag()); + const COLLADAFW::UniqueId& xmag_listid = xmag ->getAnimationList(); + if (animlist_map.find(xmag_listid) != animlist_map.end()) + type = type|CAMERA_XMAG; + } if ( type != 0) break; } - return type; } |