Animation Workflow Improvements
*Note, the above animation is a work in progress. I only added it to this post since I wanted some sort of visual.
When working on animations for games, iteration speed is very important. Especially for someone like me, who is bad at animation and makes a lot of mistakes. Its also important to check how the animation looks in game fairly often, because the animation can look different between blender and unity, and it can feel different in game play compared to looping statically. However, the time it takes to transfer animations from one software to another can be a large hurdle.
This iteration time has bogged down my animation workflow from the start of the project. I made a few mistakes early in the game's development because I didn't know the best way to export the animations from blender to unity. Because of this, it used to take ~10 minutes every time I wanted to test an animation. And these 10 minutes could quickly add up to hours when iterating on even a single animation.
Over the past few weeks I've been researching and implementing big changes to my workflow that has reduced this iteration time to ~2 minutes. I'll give a brief overview of the steps I've taken here.
From previous game dev experience, I knew it was important to separate the deformation rig from the control rig. Since the deformation rig was provided by the vroid characters, I knew it was best not to touch it. So in blender, I made a separate armature for the control rig, then constrained the deformation rig to the control rig. This worked for the animation, but whenever I wanted to export I had to bake the action from the control rig to the deformation rig. This step was tedious, and it was easy to make mistakes. It also duplicated all the actions in the file, which made the file messy and bloated. Overall, this process was tedious, error prone, and entirely unnecessary.
It turns out, when exporting an animation blender will only export bones marked as 'Deform'. This meant I could have the controls and the deform bones in the same armature, as long as I don't touch the deformation bones and I make sure all the control bones aren't marked 'Deform'. In short, I was adding a whole extra step that was entirely unnecessary.
While I was at it, I decided to completely redo the rig from scratch. This actually took most of my time over the last few weeks, as I was following along with an advanced rigging course. Though that isn't the point of this post, so I won't get into the details here. All I'll say is the new rig is so much better to work with than the old one.
Another improvement I've made to my animation workflow was using blender's linking system. This system allows you to link assets from one file to another. This makes the animation workflow better because I can keep the rig in a separate file and link it into the animation files. That way, if I need to make a change to the rig, that change will automatically show up in the animation files.
There are some issues with the linking system. Since I need to link two of the same rig, the way blender names duplicates has caused me some problems. But it is still worth it in the long run. In the future, I plan to separate all the props into their own files as well and use the linking system with those too.
The final improvement I made to my animation workflow is within Unity. When an fbx file is imported into Unity, many default settings are applied that don't work with this project's animations. Mainly the fact that Unity changes the root positions and orientations of the characters (for some reason). To fix this, I need to go through all the animations in the file and change six settings on each. This process can quickly become tedious.
To fix this, I learned how to create a custom AssetPostProcessor. This is a script that runs every time an asset is imported, and it allows me to change the default settings. Now the fbx can be imported with the correct settings without me manually having to fix it.