This is something I wanted add to Away for quite a while now and I'm pretty sure animators and game makers will be pleased with this one: Be able to have smooth transitions between actual playing animation state and the next one while still playing own smooth animation.
The engine was already able to interpolate smoothly between keyframes of an animation, but when a new animation was started, if the animator did not provide any logical keyframes to start the next one, the result was a sort of hard cut between sequences. Even with the addition of smart keyframes, there was allways a gap. Not anymore!
This little demo illustrates the differences. Just clik on the objects to toggle the animations and be able to see the transitions at work.
This behavior is now standard to the engine, and can be updated at runtime.
It works for all the supported mesh animations of the engine: md2, AS3 animated exports and the Animator class. It will be automatically triggered when a new animationSequence is started.
The standard transition duration is set to 10. Witch means that during the next 10 render sessions, the animation will be interpolated using its own animation information and will gradually get 1/10 less information of the last state of the previous animation.
To change it runtime it's easy (like most Away code):
(myanim as Mesh).transitionValue = 20;
This value for instance would, depending on swf playrate, display a very smooth transition.
Ideal for changes between logical states such as "sit" to "stand".
For transitions that should go faster, like "jump", just set the value lower.
To keep the previous engine behavior, set it to 1 witch is the lowest value possible.
(myanim as Mesh).transitionValue = 1;
You do not need to set it per enterframes unless you want to. You can set it just once if you want another value than the default 10 or set it runtime on animation changes to get most logical movements between your animation sequences. If you are pleased with the default value: do nothing!


February 2nd, 2009 at 3:43 am
do you have a fan club
you are super cool
February 2nd, 2009 at 5:12 am
HI Fab,
Thanks for this!
Ian
March 16th, 2009 at 9:16 am
Hi,
Thanks for sharing this !! but… can i have the as file to understand more about that ? many thanks ~
coz i’m new to away3D, i think this would help me really much.~
May 21st, 2009 at 9:31 pm
Hello,
Very impressive demo. I’d like to study this example further, since I’m looking to develop some games using character animation. Can you share the source code? It’d be appreciated
Thanks for all the work and excellent site!
May 22nd, 2009 at 7:28 pm
Hi Andres, well, there is no source… cause you simply do not need them, its automatic. If you need to change the transition duration, just set the mesh.transitionValue property as desired.
For more info about the way the mesh animations are done, reffer to away3d.com’s tutorials.