Frame Position

Topics: Developer Forum, User Forum
Mar 13, 2007 at 4:13 PM
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.
Mar 13, 2007 at 11:19 PM
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);