Animation export

This commit is contained in:
Alan O'Cull 2024-03-06 17:17:16 -05:00
parent 5be2218a72
commit d035d74166
5 changed files with 42 additions and 0 deletions

View File

@ -36,6 +36,8 @@ Additional notes:
## Resources and Guidelines
### Animation Guides
We are using [**Blender 3.6 LTS**](https://www.blender.org/download/lts/3-6/). As rigging changes in 4.0, please use the correct Blender version to ensure compatibility.
Guides for animation:
- [Setting Up a New Animation](docs/animation.md/#setting-up-a-new-animation)
- [Finalizing an Animation](docs/animation.md/#finalizing-an-animation)

View File

@ -40,3 +40,34 @@ If you want to go back and tweak an already-pushed animation, simply double-clic
When you're done, deselect the track and unstar it.
![](images/anim_editing2.png)
## Exporting Animations
I set up a pipeline for exporting animations that utilizes my Blender add-on, [BoneJuice](https://github.com/arocull/BoneJuice). Please download the `BoneJuice.zip` file from [here](https://github.com/arocull/BoneJuice/releases/), then in Blender go to `Edit > Preferences > Add-Ons > Install`, and select the file.
Once installed, open the animation file you want to export from. Go to the `Scripting` workspace. You might be greeted with some code. This may be out of date, so load the latest pipeline script by opening the new file (red arrow), located at `assets/pipeline/export_anims.py`.
![](images/anim_export1.png)
Once you have the file loaded, click on the character's armature in the viewport to make it active, then run the script (blue arrow).
If the script fails:
- Make sure that the character Armature is your active object
- Make sure you're not editing any animations, and that all animations are pushed to the NLA stack
- Make sure the corresponding output directory exists (`assets/export/infantry/` or `assets/export/insurrectionist/`, you may have to make these manually as they aren't synced with git)
Once the script is run, **do not save the file**.
The pipeline makes changes to the file, bakes out your animations, and intentionally breaks the rig.
If you do accidentally save the file, you can discard your changes via Git Desktop.
Your animations should be exported to the corresponding folder in `assets/export/` as an FBX file.
You can drag this FBX file into the Content folder of Unreal, preferably in the `Content/Characters/Infantry/Animations` (...or `Content/Characters/Insurrectionist/Animations/`).
When the prompt comes up for importing animations, **uncheck the Import Mesh setting, and assign the proper corresponding skeleton**. Then, press the Import All button at the end.
![](images/anim_import1.png)
Finally, make sure any looping animations are actually marked to loop.
![](images/anim_import2.png)
And viola! The implementation of animations from here on out relies on the Animation Blueprint.

BIN
docs/images/anim_export1.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
docs/images/anim_import1.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
docs/images/anim_import2.png (Stored with Git LFS) Normal file

Binary file not shown.