Animation Complete Event 4.1Alpha

Software: Away3D 4.x

geekay, Jr. Member
Posted: 24 February 2013 07:44 PM   Total Posts: 40

This should be a simple question:

How can I figure out when an animation has completed playing?


Here is a general snippet of how I am loading the animations:

//loading of a AWD file into the AssetLibrary

skeleton AssetLibrary.getAsset(BONE_LeftArmBone) as Skeleton;
mesh Mesh(AssetLibrary.getAsset(ASSET_LeftArmMesh));
animationSet = new SkeletonAnimationSet(2);
animationSet.addAnimation(AssetLibrary.getAsset(ANIMATION_LeftArmHandGrab) as AnimationNodeBase);
skeletonAnimator = new SkeletonAnimator(animationSetskeleton);
mesh.animator skeletonAnimator;
crossfadeTransition.blendSpeed crossfadeTransitionSpeed;
skeletonAnimator.play(ANIMATION_LeftArmHandGrab,crossfadeTransition); 

Where is the dispatcher in all of this that I can listen for the complete event?

Thanks so very much for your time!

   

geekay, Jr. Member
Posted: 26 February 2013 07:36 PM   Total Posts: 40   [ # 1 ]

Does anyone know how to do this?

It seems to be a fundamental part of any game or application (the ability to tell when an animation is complete)... this should not be such a hard question to answer…

   

Ankur, Jr. Member
Posted: 27 February 2013 03:10 PM   Total Posts: 43   [ # 2 ]
geekay - 26 February 2013 07:36 PM

Does anyone know how to do this?

It seems to be a fundamental part of any game or application (the ability to tell when an animation is complete)... this should not be such a hard question to answer…

+1 I would like to know as well

   

Vice, Member
Posted: 28 February 2013 11:41 AM   Total Posts: 58   [ # 3 ]

use the AnimationStateEvent.PLAYBACK_COMPLETE event to check if animations is complete.

   

geekay, Jr. Member
Posted: 28 February 2013 08:33 PM   Total Posts: 40   [ # 4 ]
Vice - 28 February 2013 11:41 AM

use the AnimationStateEvent.PLAYBACK_COMPLETE event to check if animations is complete.

Where is the event dispatcher that dispatches this event? Also can you check that it is working (when I was playing with that initially, it would just instantly dispatch that event one time, and not at the end of the animation).

Thanks for your time, I really need this for my project (and my current means of detecting the end of the animation is very cumbersome and unnecessary—- so I really hope there is way to figure this out)

ps. I think the Playback_Complete event is only fired when the ‘loop’ of the animation is set to false; The trouble is, when I set the animation loop to false it seems to break the animation for some reason…


tl;dr can you make sure this (that event) is working/dispatching properly?

Thanks!

   

geekay, Jr. Member
Posted: 03 March 2013 10:40 PM   Total Posts: 40   [ # 5 ]

I still need help

   

Vice, Member
Posted: 06 March 2013 06:31 PM   Total Posts: 58   [ # 6 ]

use “skeletonClipNode” to add the event and / or check for the duration of the animation. the animator will give you the current time elapsed.

   

geekay, Jr. Member
Posted: 07 March 2013 07:28 PM   Total Posts: 40   [ # 7 ]
Vice - 06 March 2013 06:31 PM

use “skeletonClipNode” to add the event

I would hate to be a bother… in my original post, do you know where the skeletonClipNode is kept? Thanks so very much for all of your help!

   

Vice, Member
Posted: 14 March 2013 11:39 AM   Total Posts: 58   [ # 8 ]

the animation you added to the AnimationSet is your SkeletonClipNode.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X