How to get rotation from bones at specific frames in Legacy Animation clip

I am trying to dump to a file the current state of “bones/bindposes/boneweights” (animation information) so i can paste the current state of animation to another SkinnerMeshRenderer (a clone). Cant seem to find the updated values of the rotation transforms. When playing the clip, selecting randomly a tick in time to get the current animation state of these three structures fails.
How do i get/where is it stored the rotation angles updated when playing the clip??

No matter which tick in time i select, i get dumped the same values in Bones rotation, bindposes, etc. Im trying to access it by: bones[i].rotation and bones[i].localRotation. It dumps always the same initial values.

I don’t know if this is the best way to do it, but if you don’t mind having a dummy object in your scene to simulate the animation on, you can call AnimationClip.SampleAnimation() kinda like this (the video is for foot bone height during animation, but same idea): https://youtu.be/QzMIi2gKB1A

Hi, thanks for the response.
I managed to sort it out the following way:
(1) accumulate the Time.deltaTime since the beginning of the animation
(2) when combining meshes and assigning the SkinnedMeshRenderer, set the Animation[“clipname”].time = accumulatedDeltaTimes.

That way you manage to set the restore de animation back where it was when switching the meshes.

1 Like