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-06-16 19:04:37 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-06-16 19:04:37 +0400
commit6aa524f357154fd927fff537c04c32c46611f3d0 (patch)
treeda9cc59fb29aea500454a5b819e4c52880fcb762 /source/blender/collada/AnimationImporter.cpp
parenta90d30c8638a87234048060d8fcb385369b3daaf (diff)
AnimationExporter - Quaternion to euler conversion ( in progress )
AnimationImporter - Action group assignment to bones - Revert to conversion of angles from deg to rad.
Diffstat (limited to 'source/blender/collada/AnimationImporter.cpp')
-rw-r--r--source/blender/collada/AnimationImporter.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 6efc712959f..c7f4d28e120 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -170,8 +170,8 @@ void AnimationImporter::fcurve_deg_to_rad(FCurve *cu)
for (unsigned int i = 0; i < cu->totvert; i++) {
// TODO convert handles too
cu->bezt[i].vec[1][1] *= M_PI / 180.0f;
- /*cu->bezt[i].vec[0][1] *= M_PI / 180.0f;
- cu->bezt[i].vec[2][1] *= M_PI / 180.0f;*/
+ cu->bezt[i].vec[0][1] *= M_PI / 180.0f;
+ cu->bezt[i].vec[2][1] *= M_PI / 180.0f;
cu->bezt[i].vec[1][0];
}
}
@@ -677,8 +677,8 @@ void AnimationImporter:: Assign_transform_animations(std::vector<float>* frames,
FCurve* fcu = *iter;
//if transform is rotation the fcurves values must be turned in to radian.
- /*if (is_rotation)
- fcurve_deg_to_rad(fcu); */
+ if (is_rotation)
+ fcurve_deg_to_rad(fcu);
}
COLLADAFW::Rotate* rot = (COLLADAFW::Rotate*)transform;
COLLADABU::Math::Vector3& axis = rot->getRotationAxis();
@@ -735,6 +735,7 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
armature_importer->get_rna_path_for_joint(node, joint_path, sizeof(joint_path));
bAction * act;
+ bActionGroup *grp = NULL;
if (!ob->adt || !ob->adt->action) act = verify_adt_action((ID*)&ob->id, 1);
else act = ob->adt->action;
@@ -765,8 +766,7 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
copy_m4_m4(rest, bone->arm_mat);
invert_m4_m4(irest, rest);
}
-
-
+
const COLLADAFW::TransformationPointerArray& nodeTransforms = node->getTransformations();
//for each transformation in node
@@ -803,7 +803,10 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
//Add the curves of the current animation to the object
for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
FCurve * fcu = *iter;
- BLI_addtail(AnimCurves, fcu);
+ if (ob->type == OB_ARMATURE)
+ add_bone_fcurve( ob, node , fcu );
+ else
+ BLI_addtail(AnimCurves, fcu);
}
}
std::sort(frames.begin(), frames.end());
@@ -812,7 +815,7 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
if (is_joint)
{
bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
- chan->rotmode = ROT_MODE_QUAT;
+ chan->rotmode = ROT_MODE_EUL;
}
else
{