plament

I've integrated C++ Runtime with my engine and have options to start an animation and stop all animations and return back to the setup pose. For stopping I am using:
animationState->setEmptyAnimations(duration);
Also I've AnimationStateListener object.

How exactly can check that the setEmptyAnimations() has finished? I listen for EventType_Complete but how to check that the reported TrackEntry is actually the one started from setEmptyAnimations() ?

I see the empty animation has the magic name of "<empty>" and the only method which knows about that is Animation *AnimationState::getEmptyAnimation() which is private.
plament
  • Posts: 10

Harald

Good point. Currently when you don't want to rely on the string (and save any unnecessary string comparison), you could query the number of timelines in the animation:
bool isEmptyAnimation = trackEntry->getAnimation()->getTimelines().size() == 0
User avatar
Harald

Harri
  • Posts: 1485

plament

Good to know, thanks. Maybe a helper method in a future update will be nice.
plament
  • Posts: 10


Return to Runtimes