Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-07-07 20:56:56 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-07-07 20:56:56 +0400
commitbe918954bd71ed801652039c6f4a0c98094bdc77 (patch)
tree9a36c6ffe7540d277ac4ef8294149152333dfa4e /source/blender/collada
parentc57ac39f7f0629a1ec73654664202637a07cb770 (diff)
Fixed Camera Ortho scale animation import
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/AnimationImporter.cpp29
-rw-r--r--source/blender/collada/AnimationImporter.h3
2 files changed, 23 insertions, 9 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;
}
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 22bff6e493d..138d932cdbf 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -93,7 +93,8 @@ private:
LIGHT_COLOR = 2,
LIGHT_FOA = 4,
LIGHT_FOE = 8,
- CAMERA_XFOV = 16
+ CAMERA_XFOV = 16,
+ CAMERA_XMAG = 32
};
public: