Animation Keyframes return broken data

I'm using the content pipeline, and enhancing the mesh processor to attach animation information in the Tag, so that I can animate imported meshes.

It seems that the animation keyframes return broken data when importing from .X files. They seem to duplicate the first key (with time and everything), and then fail to include the last key. This makes making an animated game challenging.

Here is an example from an animation with 41 frames, ranging from 0.0 to 1.33333:

In the .X file:

AnimationKey rot {
0;
41;
0;4;1.000000,0.000000,0.000000,0.000000;;,
160;4;0.996917,0.000000,0.000000,-0.078459;;,
320;4;0.987688,0.000000,0.000000,-0.156435;;,
480;4;0.972370,0.000000,0.000000,-0.233445;;,
640;4;0.951056,0.000000,0.000000,-0.309017;;,
800;4;0.923880,0.000000,0.000000,-0.382683;;,
960;4;0.891007,0.000000,0.000000,-0.453991;;,
1120;4;0.852640,0.000000,0.000000,-0.522499;;,
1280;4;0.809017,0.000000,0.000000,-0.587785;;,
1440;4;0.760406,0.000000,0.000000,-0.649448;;,
1600;4;0.707107,0.000000,0.000000,-0.707107;;,
1760;4;0.649448,0.000000,0.000000,-0.760406;;,
1920;4;0.587785,0.000000,0.000000,-0.809017;;,
2080;4;0.522498,0.000000,0.000000,-0.852640;;,
2240;4;0.453990,0.000000,0.000000,-0.891007;;,
2400;4;0.382683,0.000000,0.000000,-0.923880;;,
2560;4;0.309017,0.000000,0.000000,-0.951057;;,
2720;4;0.233445,0.000000,0.000000,-0.972370;;,
2880;4;0.156434,0.000000,0.000000,-0.987688;;,
3040;4;0.078459,0.000000,0.000000,-0.996917;;,
3200;4;-0.000000,0.000000,0.000000,-1.000000;;,
3360;4;-0.078459,0.000000,0.000000,-0.996917;;,
3520;4;-0.156435,0.000000,0.000000,-0.987688;;,
3680;4;-0.233446,0.000000,0.000000,-0.972370;;,
3840;4;-0.309017,0.000000,0.000000,-0.951056;;,
4000;4;-0.382684,0.000000,0.000000,-0.923880;;,
4160;4;-0.453991,0.000000,0.000000,-0.891006;;,
4320;4;-0.522499,0.000000,0.000000,-0.852640;;,
4480;4;-0.587785,0.000000,0.000000,-0.809017;;,
4640;4;-0.649448,0.000000,0.000000,-0.760406;;,
4800;4;-0.707107,0.000000,0.000000,-0.707107;;,
4960;4;-0.760406,-0.000000,-0.000000,-0.649448;;,
5120;4;-0.809017,-0.000000,-0.000000,-0.587785;;,
5280;4;-0.852640,-0.000000,-0.000000,-0.522498;;,
5440;4;-0.891007,-0.000000,-0.000000,-0.453990;;,
5600;4;-0.923880,-0.000000,-0.000000,-0.382683;;,
5760;4;-0.951056,-0.000000,-0.000000,-0.309017;;,
5920;4;-0.972370,-0.000000,-0.000000,-0.233445;;,
6080;4;-0.987688,-0.000000,-0.000000,-0.156434;;,
6240;4;-0.996917,-0.000000,-0.000000,-0.078459;;,
6400;4;-1.000000,0.000000,-0.000000,0.000000;;;
}

Code that extracts the keyframes:

foreach (AnimationKeyframe kf in (de.Value as AnimationChannel))
{
BonePose bp = new BonePose();
bp.Set(kf);
track.Add(bp);
}

(BonePose is mine; "kf" is the keyframe, and the first two both have time = 0 and the same position/orientation)

Actually retrieved from the keyframe list:

Bone Box03
frame 0: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0 W:0.9999999}
frame 0: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0 W:0.9999999}
frame 0.0333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.06985462 W:0.9975572}
frame 0.0666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.1392634 W:0.9902554}
frame 0.1: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.2077794 W:0.9781757}
frame 0.1333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.2749638 W:0.9614546}
frame 0.1666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.3403769 W:0.9402891}
frame 0.2: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.4035883 W:0.9149407}
frame 0.2333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.4641685 W:0.885747}
frame 0.2666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.5216911 W:0.8531344}
frame 0.3: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.5757275 W:0.8176416}
frame 0.3333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.6258333 W:0.7799568}
frame 0.3666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.6715291 W:0.7409781}
frame 0.4: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.7122574 W:0.7019184}
frame 0.4333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.7472961 W:0.6644912}
frame 0.4666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.914941 W:0.4035877}
frame 0.5: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9402891 W:0.3403769}
frame 0.5333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9614547 W:0.2749635}
frame 0.5666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9781758 W:0.2077794}
frame 0.6: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9902555 W:0.1392625}
frame 0.6333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9975572 W:0.0698546}
frame 0.6666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:1 W:0}
frame 0.7: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9975572 W:-0.0698546}
frame 0.7333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9902554 W:-0.1392634}
frame 0.7666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9781755 W:-0.2077802}
frame 0.8: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9614546 W:-0.2749638}
frame 0.8333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9402888 W:-0.3403776}
frame 0.8666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:0.9149404 W:-0.4035887}
frame 0.9: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.7472954 W:0.664492}
frame 0.9333333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.7122574 W:0.7019184}
frame 0.9666666: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.6715291 W:0.7409781}
frame 1: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.6258333 W:0.7799568}
frame 1.033333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.5757275 W:0.8176416}
frame 1.066667: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.5216911 W:0.8531344}
frame 1.1: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.464168 W:0.8857471}
frame 1.133333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.4035877 W:0.9149409}
frame 1.166667: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.3403769 W:0.9402891}
frame 1.2: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.2749638 W:0.9614546}
frame 1.233333: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.2077794 W:0.9781757}
frame 1.266667: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.1392625 W:0.9902555}
frame 1.3: {X:-1.341179 Y:-0.012233 Z:-0.856236} {X:0 Y:0 Z:-0.06985462 W:0.9975572}




Answer this question

Animation Keyframes return broken data

  • CoolTami

    Thanks for the report, we'll take a look at it.


  • Freedom1029

    Ill second this.  Here is a screen shot showing the loaded animation from Tiny.X (taken during gametime):
    http://img205.imageshack.us/img205/7199/animationbughi7.jpg


    As you can see, the first two keyframes are duplicated.  I attached this animation info using the Tag, just like the previous poster.

  • Animation Keyframes return broken data