Menu

[Q] Animation frames

2009-01-20
2013-06-03
  • Andy Maloney

    Andy Maloney - 2009-01-20

    When I have an aiAnimation, how do I determine the total number of frames in it?  Do I need to look at each of the channels and take the max of all their position, rotation, and scaling keys?

    Never worked with animations before...

    [Side note: dox.h makes reference to aiBoneAnim:

    "The aiAnimation consists of a series of aiBoneAnims. Each bone animation..."

    This should be:

    "The aiAnimation consists of a series of aiNodeAnims. Each node animation..."
    ]

     
    • Alexander Gessler

      >> When I have an aiAnimation, how do I determine the total number of frames in it? Do I need to look at each of the channels and take the max of all their position, rotation, and scaling keys?

      There is aiAnimation::mDuration which is already exactly this 'max'.

      However, the frames aren't frames, they're keyframes. Their times are sorted in ascending order, but the distance on the time line from one keyframe to the next needn't be a constant.

      E.g.

      keyframe_position0
         time: 0
         value:0 0 0

      keyframe_position1
         time: 1
         value:1 0 0

      keyframe_position2
         time: 10 (!)
         value:1 0 100000000

      If there are no other keys, aiAnimation::mDuration would be 10 in this case, as 10 is the last time value for which a keyframe is specified.

      Hope that helps!
      Bye,
      Alex

      PS: fixed that doc issue ...

       
    • Andy Maloney

      Andy Maloney - 2009-01-21

      Thanks Alex - that clarifies a bit.  Going to take me a little while to wrap my head around two animation systems [this one and the one I'm trying to convert to] with all their associated translations/rotations/keyframes etc...

      Thanks for all your work on this lib!

       

Log in to post a comment.