Download

Getting Current Frame or Time of Animation

Guys,

Is there a simple way of reading out the current frame out of total or percentage executed out of an animation. I am trying to understand where the Right foot is in an animation so that I can feed a blend space variable into a run stop animation (to animate the stop on the right foot).

Any tips?

C

There are multiple ways of doing this. Either create a notify for each foot in the animations or a custom curve track, inside the animation editor. With the notifies you set a boolean for which stop animation to use or you query the curve values for which foot is dominant to determine that. There are more ways than these two examples, but they should get you started.

How do you query the curve value though? Seems like there is no way to do this in BP today is there?

That is very likely the case. I’m used to C++ projects, so if it is not exposed I do it myself. The notifies should otherwise be a decent solution. It’s very similar to what NaturalMotion does in Morpheme. Each animation has foot down “states”, then the animation engine tries to handle state transitions based on the average of the blended states. At least that’s how it appeared to me the short time I used it several years ago.

Thanks. I played around with notify yesterday. For some reason it didnt seem to trigger reliable. I.e. the amount of “ticks” was different from time to time in the same animation. I looked at Curve data and it seems like this is still mainly only exposed in C++ functions but in one of the upcoming releases very soon (i.e. the C++ function is exposed as BP_Internal_Only).

Here is the function I mentioned

/** Returns how long until the end of the animation AnimAsset we are (as a proportion between 0.0 and 1.0). /
UFUNCTION(BlueprintPure, Category=“Animation”, meta=(BlueprintInternalUseOnly = “true”))
static float GetAnimAssetPlayerTimeFromEndFraction(UAnimationAsset
AnimAsset, float CurrentTime);