Frame Position

Topics: Developer Forum, User Forum
Mar 13, 2007 at 5:13 PM
Hi,
is possible to find out the frame an animation is on, for instance if you want to know when a particular frame is reached during an animation play back, how would you do this.
thanks
Coordinator
Mar 14, 2007 at 12:19 AM
Yes. But keep in mind that since the frames are interpolated to 60 fps by default (see extending the pipeline tutorial if you want to override this) so the keyframe indices wont match what is in your file.

long time = 30333;
AnimationChannelCollection channels = myAnimation.AnimationSource.AnimationChannels;
BoneKeyframeCollection myBoneKeyframes = channels"MyBone";
BoneKeyframe frame = myBoneKeyframesmyBoneKeyframes.GetIndexByTime(time);