Hello. I am using looking at the Intermediate_MD5Animation example that comes with the away3d 4.1.0 examples. I have added some code to try and access the current frame of animation:
import away3d.animators.states.AnimationClipState;
public var clipStates:Vector.<AnimationClipState>;
clipStates = new Vector.<AnimationClipState>;
if (event.asset.assetType == AssetType.ANIMATION_NODE) {
var node:SkeletonClipNode = event.asset as SkeletonClipNode;
var name:String = event.asset.assetNamespace;
var clipState:AnimationClipState = new AnimationClipState(animator, node); // added code
clipStates.push(clipState); // added code
node.name = name;
in the onEnterFrame function i have added :
for each(var clipState:AnimationClipState in clipStates) {
trace(clipState.currentFrame);
}
When I do this I get all zeros for my output even though the character is clearly playing animation. How do I access the current frame of an MD5 animation?
I know that a SkeletonClipNode can return the number of frames in an animation, but how do I get the current frame of the current animation from a SkeletonAnimator? thank you.