Does anyone know of a way on how to, having an animation sequence, extract locations/transformations of each bone in a given frame? I don’t need to modify the bone locations, I only need to get out the data to use it later on.
This would be definitely something I would like to avoid - the engine has already done this, so it would be illogical to parse the file once again myself.
I believe that the track index actually maps to a bone index somehow. Probably through the use of a skeleton asset.
The skeleton asset stores the hierarchy and the starting transform of each bone, the animation sequence asset is a series of offset keyframes (over time). Also, animation tick is different than the normal blueprint/c++ tick so you can’t listen in-game once and save to a file either
So if I understand correctly - the first frame of the animation sequence holds bone transforms relative to the reference pose in the skeleton asset. Am I correct?
. The blue lines are of bones from the ragdoll, the red ones are the animation bones. Doesn’t seem right to me. Is there a bug in my function or are the positions in the animation different? You can clearly see some features there, e.g. hands
(Please calculate InTime for required frame of AnimSequence by doing some math) Here’s documentation
Now…
I’m also looking for an answer to this question, but I want location of bone in worldspace.
What I’ve observed so far:
In persona editor i can see both local as well as world location of a bone/track in an animation sequence. But i couldn’t find that functionality in scripting (c++).
2. Other way is to convert the relative bone location to world location
Think about it logically.
Your relative location is the vector you must move, starting from the root bone, to get to your specific bone’s location. So to convert, all you need to do is add the root bone’s location, which should be equal to the MeshComponent’s location.
The function GetComponentLocation returns the location in world space. So add your bone’s relative location and you’re there.
Ooops, the local transform (in the FPoseSnapshot) is not accurate, is containing some offset (see the picture below).There’s no error in process of converting from LocalTransform to WorldTransofrm. Donno why?