Is it possible to create AnimationClips at runtime? How about humanoid? Say I have some mo-cap data generated at runtime, how would I go about creating a mecanim-ready animation clip out of it?
Wow, I was just about to post this exact same question! Crazy right? I found this repo: https://github.com/newyellow/Unity-Runtime-Animation-Recorder However, when I take the same animation clip and try to apply it back to my humanoid character, it doesn't work because it's not a Humanoid clip. There doesn't appear to be any way to mark the clip as Humanoid (the properties are readonly and internal). So at first blush this doesn't seem possible. But hopefully someone can enlighten us here!
Slight update: I was able to use Unity's new FBX exporter to export my rig with the recorded animations and then re-import them. This is a hackish workaround for sure, but it does have the added benefit of using Unity's built-in keyframe reduction, which is definitely required in this case because the animation recorder has extremely dense keyframes.
Unfortunately it's not possible to create AnimationClips at runtime (except Legacy ones). So you either need to use Legacy animations or apply the mocap data yourself without using the animation system.
Hello, I am looking to automate some simple animations using predefined keyframes. I believe this is possible by creating a custom editor window. I was just wondering if you are looking to do something similar and maybe we could solve this problem together, because I had looked at automating the creation of animations at runtime before I knew it could be done through editor window.