Game animations: Share your workflows creating/managing/exporting your animations

Hi all.

I’m having a bit of a rough time trying to come up with a good way of getting animations ready for games in unity 5 and i thought i’d see how other people generally handle it and see if i can learn some good habits. So please feel free to go into length about the ways you’ve streamlined the experience for yourselves. :slight_smile:

Using the action editor in the dope sheet and setting a fake user for all your animations allows Unity to read each of your animations as separate clips. I know some people who prefer to export as motion capture files instead, but I like having it all in one file.

I always keep a source Blend and a baked blend for Unity. To update the baked blend, I delete all my custom bone shape meshes (Widgets) and use Pose->Bake Action with the clear constraints and overwrite current action boxes checked for each of my animations.

Those two things will get you up and running. Note: You may find you’ll need to modify Unity’s import settings to fix rotation and scale.

Now for some advanced stuff:
Unfortunately, despite both Blender and Unity using an animation curve system to ultimately drive animations, there is no way to copy this data directly into Unity without scripting in both systems. For the most part, if you ensure your curves are correct before baking the action, Unity will preserve the animation quite well. However, even with optimal key frame reduction in Unity, you’ll still have more key frames and slight animation errors than your original animation before baking the action. Animating at higher frame rates in Blender helps preserve the curves better too.

Pose libraries are saved as actions with a pose per frame. They can be really useful with masks to support customization. Hands holding weapons are a good example.

In Unity’s program files, editor->data->tools will take you to the import python script in which you’ll find they use the ascii defaults dictated by the blender script in <Blender Version #> -> scripts->addons->io_scene_fbx->export_fbx. It is free to study or bend to your will!

I know there’s some issues regarding shape key animations. The simplest approach (albeit tedius) was to re-implement the drivers in C# script. I can’t remember if those issues have been resolved yet.