diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-06 22:09:36 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-06 22:09:36 +0400 |
commit | 6c88a16b3a743cef95aa6c7b4ca49c173e5c77a5 (patch) | |
tree | d957c2654d8502d0d9c3e821dabad37e5a856d57 /source/blender/collada | |
parent | 1e14e2f465c749b5fe39c1a22ea562059b9fad65 (diff) |
Camera lens animation Identifying
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 17 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.h | 5 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 1 |
3 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index e21a9370935..d35c3649ab5 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -905,7 +905,22 @@ int AnimationImporter::get_animation_type ( const COLLADAFW::Node * node , if ( type != 0) break; } - + + const COLLADAFW::InstanceCameraPointerArray& nodeCameras = node->getInstanceCameras(); + 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()) + type = type|CAMERA_XFOV; + + + if ( type != 0) break; + + } + return type; } diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h index 5a9638d2bb2..22bff6e493d 100644 --- a/source/blender/collada/AnimationImporter.h +++ b/source/blender/collada/AnimationImporter.h @@ -38,11 +38,13 @@ #include "COLLADAFWNode.h" #include "COLLADAFWUniqueId.h" #include "COLLADAFWLight.h" +#include "COLLADAFWCamera.h" #include "DNA_anim_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_lamp_types.h" +#include "DNA_camera_types.h" //#include "ArmatureImporter.h" #include "TransformReader.h" @@ -90,7 +92,8 @@ private: NODE_TRANSFORM = 1, LIGHT_COLOR = 2, LIGHT_FOA = 4, - LIGHT_FOE = 8 + LIGHT_FOE = 8, + CAMERA_XFOV = 16 }; public: diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 2815d8703ed..a5946b4aa88 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -854,6 +854,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) } this->uid_camera_map[camera->getUniqueId()] = cam; + this->FW_object_map[camera->getUniqueId()] = camera; // XXX import camera options return true; } |