Finishing Animation Importing part 2 (Patreon)
Content
There was a ton of stuff I had to finish up on the animation importing side of things. As I said in the last devpost, I was having difficulty translating rotations. This has been fixed and now animations are imported properly at runtime. Such as this example:
The next step I took was making these character animations generic. By this I mean being able to apply the same animation to other character models. The problem here was that different characters have different armatures (different bone rotations). So despite the Chino and Eli models both having 2 legs, the rotation of their leg bones might differ by a few degrees whenever they were built. Playing the same animation can have the following effect:
Regular animation ^
Same animation applied to a different character armature ^
The solution for this was make all character bones share the same rotations and apply these bone offsets to all animations. This proved to be a somewhat annoying task since quaternions can get messy but it produced fruitful results. Now Eli can play all Chino animations!
If you are familiar with Unity this may sound like Unity's mecanim system. That's because that's what mecanim is!
I basically remade mecanim for runtime. Why? Because Unity does not yet have the ability to create animations at runtime, only in the editor. So I had to make my own system for this :\
Despite this hurdle, this new runtime generic animation system is a powerful addition to the tooling that modders will be able to use to create and share animations for other characters at runtime, in an easy way, without opening Unity, and by dragging & dropping.fbx files into the game. Very convenient.
Next up, binding ragdoll physics to animations and after that, runtime scripting for modding!
Stay tuned!