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-09 23:33:02 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-07-09 23:33:02 +0400
commitdaddbc62df5f8ade39b25acd4e333c5c3bd88b5a (patch)
tree821f4c9e83110e7db0517e279e435758f0fd2688 /source/blender/collada/AnimationImporter.cpp
parenteb452225cec986e44f049d0cd42e862be13e4126 (diff)
Diffstat (limited to 'source/blender/collada/AnimationImporter.cpp')
-rw-r--r--source/blender/collada/AnimationImporter.cpp91
1 files changed, 57 insertions, 34 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 5f4d4905646..030b9e7582b 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -919,28 +919,30 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
for (unsigned int i = 0; i < nodeLights.getCount(); i++) {
const COLLADAFW::Light *light = (COLLADAFW::Light *) FW_object_map[nodeLights[i]->getInstanciatedObjectId()];
+ //
+ //const COLLADAFW::Color *col = &(light->getColor());
+ //const COLLADAFW::UniqueId& col_listid = col->getAnimationList();
+
+ ////check if color has animations
+ //if (animlist_map.find(col_listid) != animlist_map.end())
+ //// type = type|LIGHT_FOA;
+ // types->light = types->light|LIGHT_COLOR;
+ types->light = setAnimType(&(light->getColor()),(types->light), LIGHT_COLOR);
+ //
+ //const COLLADAFW::AnimatableFloat *fallOffAngle = &(light->getFallOffAngle());
+ // const COLLADAFW::UniqueId& foa_listid = fallOffAngle ->getAnimationList();
+
+ //if (animlist_map.find(foa_listid) != animlist_map.end())
+ //// type = type|LIGHT_FOA;
+ // types->light = types->light|LIGHT_FOA;
+ types->light = setAnimType(&(light->getFallOffAngle()),(types->light), LIGHT_FOA);
+ //const COLLADAFW::AnimatableFloat *fallOffExpo = &(light->getFallOffExponent());
+ // const COLLADAFW::UniqueId& foe_listid = fallOffExpo ->getAnimationList();
+ //if (animlist_map.find(foe_listid) != animlist_map.end())
+ // //type = type|LIGHT_FOE;
+ // types->light = types->light|LIGHT_FOE;
- const COLLADAFW::Color *col = &(light->getColor());
- const COLLADAFW::UniqueId& col_listid = col->getAnimationList();
-
- //check if color has animations
- if (animlist_map.find(col_listid) != animlist_map.end())
- // type = type|LIGHT_FOA;
- types->light = types->light|LIGHT_COLOR;
-
- const COLLADAFW::AnimatableFloat *fallOffAngle = &(light->getFallOffAngle());
- const COLLADAFW::UniqueId& foa_listid = fallOffAngle ->getAnimationList();
-
- if (animlist_map.find(foa_listid) != animlist_map.end())
- // type = type|LIGHT_FOA;
- types->light = types->light|LIGHT_FOA;
-
- const COLLADAFW::AnimatableFloat *fallOffExpo = &(light->getFallOffExponent());
- const COLLADAFW::UniqueId& foe_listid = fallOffExpo ->getAnimationList();
-
- if (animlist_map.find(foe_listid) != animlist_map.end())
- //type = type|LIGHT_FOE;
- types->light = types->light|LIGHT_FOE;
+ types->light = setAnimType(&(light->getFallOffExponent()),(types->light), LIGHT_FOE);
//if ( type != 0) break;
if ( types->light != 0) break;
@@ -950,24 +952,37 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
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()];
-
+
+
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;
- types->camera = types->camera|CAMERA_XFOV;
-
+ //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;
+ // types->camera = types->camera|CAMERA_XFOV;
+ types->camera = setAnimType(&(camera->getXMag()),(types->camera), 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;
- types->camera = types->camera|CAMERA_XMAG;
- }
+ //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;
+ // types->camera = types->camera|CAMERA_XMAG;
+ types->camera = setAnimType(&(camera->getXMag()),(types->camera), CAMERA_XMAG);
+ }
+
+ //const COLLADAFW::AnimatableFloat *zfar = &(camera->getFarClippingPlane());
+ //const COLLADAFW::UniqueId& zfar_listid = zfar ->getAnimationList();
+ //if (animlist_map.find(zfar_listid) != animlist_map.end())
+ // //type = type|CAMERA_XFOV;
+ // types->camera = types->camera|CAMERA_ZFAR;
+
+
+ types->camera = setAnimType(&(camera->getFarClippingPlane()),(types->camera), CAMERA_ZFAR);
+ types->camera = setAnimType(&(camera->getNearClippingPlane()),(types->camera), CAMERA_ZNEAR);
+
//if ( type != 0) break;
if ( types->camera != 0) break;
@@ -975,6 +990,14 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
return types;
}
+int AnimationImporter::setAnimType ( const COLLADAFW::Animatable * prop , int types, int addition)
+{
+ const COLLADAFW::UniqueId& listid = prop->getAnimationList();
+ if (animlist_map.find(listid) != animlist_map.end())
+ return types|addition;
+ else return types;
+}
+
//XXX Is not used anymore.
void AnimationImporter::find_frames_old(std::vector<float> * frames, COLLADAFW::Node * node , COLLADAFW::Transformation::TransformationType tm_type)
{