[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38061] branches/soc-2011-pepper/source/ blender/collada: AnimationType Enum.
Sukhitha Jayathilake
pr.jayathilake at gmail.com
Sun Jul 3 14:33:52 CEST 2011
Revision: 38061
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38061
Author: phabtar
Date: 2011-07-03 12:33:52 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
AnimationType Enum.
Modified Paths:
--------------
branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp 2011-07-03 12:30:54 UTC (rev 38060)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp 2011-07-03 12:33:52 UTC (rev 38061)
@@ -680,9 +680,9 @@
Object *ob = is_joint ? armature_importer->get_armature_for_joint(root) : object_map[node->getUniqueId()];
const char *bone_name = is_joint ? bc_get_joint_name(node) : NULL;
-
- if ( ! is_object_animated(node, FW_object_map) ) return ;
+ AnimationType type = get_animation_type(node, FW_object_map );
+
char joint_path[200];
if ( is_joint )
@@ -754,9 +754,11 @@
}
//Check if object is animated by checking if animlist_map holds the animlist_id of node transforms
-bool AnimationImporter::is_object_animated ( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map )
+AnimationImporter::AnimationType AnimationImporter::get_animation_type ( const COLLADAFW::Node * node ,
+ std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map)
{
- bool exists = false;
+ AnimationImporter::AnimationType type = AnimationImporter::INANIMATE ;
+ //bool exists = false;
const COLLADAFW::TransformationPointerArray& nodeTransforms = node->getTransformations();
//for each transformation in node
@@ -768,7 +770,7 @@
if (animlist_map.find(listid) == animlist_map.end()) continue ;
else
{
- exists = true;
+ type = AnimationImporter::NODE_TRANSFORM;
break;
}
}
@@ -783,12 +785,12 @@
if (animlist_map.find(listid) == animlist_map.end()) continue ;
else
{
- exists = true;
+ type = AnimationImporter::LIGHT_COLOR;
break;
}
}
- return exists;
+ return type;
}
//XXX Is not used anymore.
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 2011-07-03 12:30:54 UTC (rev 38060)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 2011-07-03 12:33:52 UTC (rev 38061)
@@ -80,6 +80,13 @@
void fcurve_deg_to_rad(FCurve *cu);
void add_fcurves_to_object(Object *ob, std::vector<FCurve*>& curves, char *rna_path, int array_index, Animation *animated);
+
+ enum AnimationType
+ {
+ NODE_TRANSFORM,
+ LIGHT_COLOR,
+ INANIMATE
+ };
public:
AnimationImporter(UnitConverter *conv, ArmatureImporter *arm, Scene *scene);
@@ -101,7 +108,7 @@
std::map<COLLADAFW::UniqueId, Object*>& object_map ,
std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map);
- bool is_object_animated ( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId,const COLLADAFW::Object*> FW_object_map ) ;
+ AnimationType get_animation_type( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId,const COLLADAFW::Object*> FW_object_map ) ;
void Assign_transform_animations(COLLADAFW::Transformation* transform ,
More information about the Bf-blender-cvs
mailing list