Game Development Community

Can I get a name of an animation that is playing now

by genomegames · in Torque 3D Professional · 03/01/2011 (3:15 pm) · 6 replies

Hello everybody!
How to learn what animation is playing now?
Thank you

#1
03/01/2011 (11:28 pm)
You can get the number of the current playing animation calling getSequence(), using the action animation thread as a parameter.
#2
03/02/2011 (3:58 am)
Thank you, Ivan, very much!
#3
03/02/2011 (9:49 am)
I thought all my troubles go away but I was wrong.
I write:

if ((mShapeInstance->getSequence(mActionAnimation.thread) == playerWomanData::SideRunLeftAnim)

and always get difference in 20 between two values. Where am I wrong?
#4
03/02/2011 (10:15 am)
getSequence(mActionAnimation.thread) always returns a maximum value
#5
03/02/2011 (10:36 am)
I've solved:
I must to write:

playerWomanData::ActionAnimation &anim = mDataBlock->actionList[playerWomanData::SideRunLeftAnim];
if (mShapeInstance->getSequence(mActionAnimation.thread) == anim.sequence) {
//do something...
}

Now it's working cod
#6
03/18/2011 (8:19 pm)
I can get the movement animation by this method. IOW, I can get a name of an animation that was defined in an engine.
How can I get a name or an index of an animation that is playing now if this animation was called from script?