Hi all, I am finally gaining some understanding of bones animation in Away 3D and I am posting a summary in case others are confused like I was.
A Skeleton represents the bones affecting your mesh. It is separated from animation info so that the same skeleton can be used for different meshes in different poses.
A SkeletonPose is a single keyframe of a bones animation.
A SkeletonClipNode is a single named animation for a mesh, such as WALK, SHOOT, etc. SkeletonPoses (keyframes) are added to a SkeletonClipNode. (I was originally confused because I thought ‘clip’ referred to some kind of 3D clipping, but I believe they are using it in the sense of a movie ‘clip’).
These nodes (animations) are grouped together in a SkeletonAnimationSet.
To actually play one of the animations you make use of a SkeletonAnimator which is attached to your mesh.
A CrossFadeTransition can be used to move between poses in a blended way.
Based off of Rob Bateman’s polar bear example, here is one good way to do this sequence:
* When you load your model set up an onAssetComplete handler as shown in many of the examples.
* Once you get the SKELETON asset you can go ahead and create a new animationSet and animator.
animationSet = new SkeletonAnimationSet();
animator = new SkeletonAnimator(animationSet, skeleton);
* don’t forget to add the animator to your mesh:
mesh.animator = animator;
* For every ANIMATION_NODE asset that you handle, add it to the animationSet.
var clipNode:SkeletonClipNode = event.asset as SkeletonClipNode;
animationSet.addAnimation( clipNode );
* You can use keyboard or mouse handlers to drive which animation plays when. You can use a transition to smooth any switches:
var stateTransition:CrossfadeTransition = new CrossfadeTransition( 0.5);
animator.play(animName, stateTransition);
As far as I can tell no ANIMATION_STATE assets are handled or used in this process.
That’s my current understanding. If I’ve gotten something wrong or left something out please let me know, thanks!
—Skyser