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-08-21 19:47:21 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-08-21 19:47:21 +0400
commit6b99cd05aa5528a931e391c5d78278aeaa6dd861 (patch)
tree4a630c1964f61032429c7e13c2cc52c888255bb6 /source/blender/collada/ArmatureImporter.cpp
parent4f75566672b06931556888b0b300533c110d6e3d (diff)
Armature object animations export.
Diffstat (limited to 'source/blender/collada/ArmatureImporter.cpp')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 67828fb967d..1e7879b352f 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -82,6 +82,10 @@ JointData *ArmatureImporter::get_joint_data(COLLADAFW::Node *node);
void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *parent, int totchild,
float parent_mat[][4], Object * ob_arm)
{
+ std::vector<COLLADAFW::Node*>::iterator it;
+ it = std::find(finished_joints.begin(),finished_joints.end(),node);
+ if ( it != finished_joints.end()) return;
+
float mat[4][4];
float obmat[4][4];
@@ -151,11 +155,18 @@ void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *p
add_leaf_bone(mat, bone, node);
}
+ finished_joints.push_back(node);
+
}
void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
float parent_mat[][4], bArmature *arm)
{
+ //Checking if bone is already made.
+ std::vector<COLLADAFW::Node*>::iterator it;
+ it = std::find(finished_joints.begin(),finished_joints.end(),node);
+ if ( it != finished_joints.end()) return;
+
float joint_inv_bind_mat[4][4];
// JointData* jd = get_joint_data(node);
@@ -183,10 +194,10 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
else
copy_m4_m4(mat, obmat);
- /*float loc[3], size[3], rot[3][3] , angle;
+ float loc[3], size[3], rot[3][3] , angle;
mat4_to_loc_rot_size( loc, rot, size, obmat);
mat3_to_vec_roll(rot, NULL, &angle );
- bone->roll=angle;*/
+ bone->roll=angle;
}
@@ -257,6 +268,8 @@ void ArmatureImporter::create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBo
if (!children.getCount() || children.getCount() > 1) {
add_leaf_bone(mat, bone , node);
}
+
+ finished_joints.push_back(node);
}
void ArmatureImporter::add_leaf_bone(float mat[][4], EditBone *bone, COLLADAFW::Node * node)
@@ -659,7 +672,7 @@ void ArmatureImporter::make_armatures(bContext *C)
}
//for bones without skins
- //create_armature_bones();
+ create_armature_bones();
}
#if 0