stopping animation at any frame
by PGames · in Torque 3D Professional · 08/09/2010 (2:01 am) · 2 replies
Is there a way to get the real time frame of an animation and the stop the animation? Basically, I want to play an animation, say a walk, then stop said animation the moment I press a key and have it blend directly into the next animation. To do this, I need to know the exact frame reference of the walk animation when I press the key and be able to stop it.
I'm using this right now to try to stop the animation in player.cpp:
But, it doesn't work, anyone know what's wrong?
Also, the blending between animations in the object editor looks really good, does anyone know where the code for that is? I would like to use that to create the inbetween animations (say from running to attack stance).
I'm using this right now to try to stop the animation in player.cpp:
void Player::stopPlayOnce()
{
mShapeInstance->setTimeScale(mArmAnimation.thread,0.0);
// only do this if on server
if (!isGhost())
setArmThread(mArmThreadSavedAction);
}But, it doesn't work, anyone know what's wrong?
Also, the blending between animations in the object editor looks really good, does anyone know where the code for that is? I would like to use that to create the inbetween animations (say from running to attack stance).
Associate Chris Robertson
The Shape Editor code is in gui/editor/guiShapeEdPreview.cpp. It uses the standard TSShapeInstance methods for animation.