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..."
]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>> 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.
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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..."
]
>> 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 ...
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!