SkeletonAnimationSequence and multiple mesh

Software: Away3D 4.x

kornwaretm, Newbie
Posted: 11 October 2011 06:08 PM   Total Posts: 21

hai
firstly i`m not sure i`m on the right path. I’m trying to play skeletal animation from sequence to another. in this case from walking animation to attacking animation. so i use listener to detect if the sequence is complete

walk   = (AssetLibrary.getAsset(walkAnimName) as SkeletonAnimationSequence);
walk.looping false;
walk.addEventListener(AnimatorEvent.SEQUENCE_DONEwalkFinish); 

it work fine for one mesh. when i make 5 or more character, the animation stuck. i realize that i must clone this “walk”. Because AssetLibrary.getAsset will share the same SkeletonAnimationSequence for all the character, while i need to handle them for each character. sadly the clone() is not exist.

is there anyway to do this?

   

kornwaretm, Newbie
Posted: 12 October 2011 03:18 PM   Total Posts: 21   [ # 1 ]

it seems adding event listener for now is not a good solution. so i set up timer and wait along with the played sequence. problem solved.

   

StefC, Newbie
Posted: 23 November 2011 09:16 AM   Total Posts: 3   [ # 2 ]

Indeed, if you add different SkeletonAnimationSequences to your project and handle every single model with another SkeletonAnimationSequence instance, you can control the models perfectly.

Example:

var seq SkeletonAnimationSequence evt.asset as SkeletonAnimationSequence;
seq.name="YourChosenAnimNameIdentifier";
seq.looping false;
seq.addEventListener(AnimatorEvent.SEQUENCE_DONE,onBoxSeqDone); 

It’s also a good solution for the issue where the SkeletonAnimator don’t listen to the events you added to an SkeletonAnimator object.
(Thread: http://away3d.com/forum/viewthread/827/#4670)

Issue code example:

_myAnimationController = new SkeletonAnimator(SkeletonAnimationState(myMesh.animationState));
   
_myAnimationController.addEventListener(AnimatorEvent.STOP,onAnimStopEventHandler);
   
_myAnimationController.addEventListener(AnimatorEvent.START,onAnimStartEventHandler); 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X