Discovery, Inspirations, Thoughts.

Friday, 28 November 2014

Preparing 3D rig and animation files for Unity

17:30 Posted by Unknown , , No comments

After fumbling for a few days, we found out the best way (yet) to prepare 3D rig and animation FBX files for our Unity game. This is just a guide on how we prepare our files. The way we prepare the assets might or might not be suitable for you.

Getting the Rig/T-Pose file

1. Open up your animation .ma file. Import all references.
2. Select all Controllers (you can do it easily by muting mesh, joints and ik handle selection so that when you drag across your model, only NURB controllers are selected).
3. Zero out the translation and rotations.
4. File > Export All. Select FBX file type to export, and make sure the Animation checkbox is off before you export. Now you'll have your Rig/T-pose file.


Exporting Animations

1. Undo back few steps till the translations and rotations were not zero-ed out.
2. Open up your Axtended GUI window from your shelf. (If you haven't had Axtended installed yet, do refer to my post here to see how to do it)
3. Add your animations. Right-click on the Animation List area and click Add/Edit Animation.
4. Type in your animation name and its start and end frames, then click on Add to add the animation to your Animation List.
5. After you had finished adding in the animations, right-click on the Animation List area again and click Export List to File to export your animation list to a text file as a backup, just in case.
6. Before you start exporting, you need to Bake your animation. Go to Window > Hypergraph: Hierarchy and select everything inside the Hierarchy window. Then go to Edit > Keys > Bake Simulation.
7. After the baking is done, delete the mesh. Now you only have the bones and controllers in the scne.
8. Go to File > TOGGLE FBX in your Axtended window and make sure TOGGLE FBX is ON.
9. Start batch exporting your animation. Right-click on the Animation List area and click on Export All Animations
10. Wait for the process to be done! Now you'll have your Animation data files.

Importing Rig and Animation FBX into Unity

1. Drag the Rig and Animation FBX files into your Unity Project window to import them into Unity.
2. Go to the Rig tab of the files and select Generic from Animation Type, and Create From This Model for Avatar Definition. Hit Apply.
3. Select any animation FBX file and go to its Animation tab. You'll see the window below that says "No model is available for preview". Drag your rig FBX file to this window and click on the Play button at the window to see your animation.

0 comments:

Post a Comment