locked
Keyframe animation

    Question

  • I have a simple test model modeled in GameSpace Lite, which has a small animation in it - saved as text this is all there is for it -

     

    AnimationSet Stand {
     Animation Animation0 {
      {Mesh-0}
      AnimationKey {
       2;
       3;
       0; 3; 0.000000, 0.000000, 0.000000;;,
       930; 3; 0.000000, 0.500000, 0.000000;;,
       1935; 3; 0.000000, 0.000000, 0.000000;;;
      }
      AnimationKey {
       0;
       3;
       0; 4; 1.000000, 0.000000, 0.000000, 0.000000;;,
       930; 4; 1.000000, 0.000000, 0.000000, 0.000000;;,
       1935; 4; 1.000000, 0.000000, 0.000000, 0.000000;;;
      }
      AnimationOptions {
       1;
       0;
      }
     }
    }

     

    Now, After loading this using the Content pipeline defaults I cant see any way of extracting any animation data. So I'm guessing that this is time for a custom processor? If so does anyone have any pointers or clues?

    Any help would be appreciated!

    N

    Sunday, November 05, 2006 5:24 PM

Answers

  • Yes, animations are loaded into the intermediary representation, but not included in the Model. You can derive from the model processor, and attach animation data in a format of your choosing to the Model Tag property. You will also have to write custom marshallers for this animation format.

    Note that there are a few bugs with animation. Most important is the bug where you don't seem able to match up skinned mesh bone subsets with the hierarchy bones; especially not if you also need to break the skinned mesh into chunks because of bone palette size. Another kind-of annoying bug is that the first keyframe will be duplicated, and the last keyframe will be dropped, by the X file importer.

    Sunday, November 05, 2006 8:04 PM

All replies

  • Yes, animations are loaded into the intermediary representation, but not included in the Model. You can derive from the model processor, and attach animation data in a format of your choosing to the Model Tag property. You will also have to write custom marshallers for this animation format.

    Note that there are a few bugs with animation. Most important is the bug where you don't seem able to match up skinned mesh bone subsets with the hierarchy bones; especially not if you also need to break the skinned mesh into chunks because of bone palette size. Another kind-of annoying bug is that the first keyframe will be duplicated, and the last keyframe will be dropped, by the X file importer.

    Sunday, November 05, 2006 8:04 PM
  • OK,

    I've written a custom processor, which currently only logs the data like so -

    foreach (AnimationContent content in input.Animations.Values)

    {

    context.Logger.LogImportantMessage("{0}",content.Name);

    context.Logger.LogImportantMessage("{0}", content.Duration);

    foreach (AnimationChannel channel in content.Channels.Values)

    {

    foreach (AnimationKeyframe keyFrame in channel)

    context.Logger.LogImportantMessage("{0}", keyFrame.Transform.ToString());

    }

    }

    I just need to develop a way of stroting it and then I'm off! I get 1 Animation Content, 1 Channel and 3 Keyframes, so We're all good I think so far.

     

    Cheers

    N

    Sunday, November 05, 2006 8:48 PM