Follow

FBX import into Unity

Some Characters (such as the Mixamo characters) are not set up to work with the imported FBX data in Unity. This article gives you an easy workflow on how to make those characters suitable.

1. Importing MVN Mocap Data

1.1 Import Character

For this workflow, the Ninja Character is used.

1. In your Unity project, right-click in your assets folder and select Import New Asset.

 mceclip0.png

2. Select your character and select Import. The character will now be available in the assets folder. Select the character. it will show up in the Inspector pane on the right.

mceclip2.png

3. In the Rig tab, choose the Animation Type: Humanoid. Click Apply. 

4. Drag the character into your scene. 

 

1.2 Import Animation FBX

1. Right-click in your assets folder and select Import New Asset.

mceclip0.png

2. Select your FBX containing Animation data and select Import. The animation will now be available in the assets folder. Select the animation. it will show up in the Inspector pane on the right.

mceclip3.png

3. In the Rig tab, choose the Animation Type: Humanoid. Click Apply. 

 

1.3 Create Animation Controller

1. Right-click in your assets folder and select Create > Animator Controller

mceclip5.png

 

2. Double-click the created Animator Controller to open the Animator window.

mceclip6.png

 

3. Drag the imported Animation from the Asset folder into the Animator window.

mceclip7.png

 

1.4 Add Animation to Character

1. Select the character in your scene. 

2. Drag the Animation Controller into the Controller in the Inspector window (under Animator)

mceclip9.png

 

1.5 Correct Animation Rig

In some characters (such as Mixamo Characters), the animation may turn out twisted around the pelvis bone. This is due to the Animation's hip bone not correctly being assigned. Ninja's are supposed to be agile, but this is even beyond there limits. 

mceclip10.png

In that case, you have to adjust the Animation rig to make the animation work correctly. 

1. Select the Animation in the Assets folder. 

2. In the Inspector window, click Configure under Avatar Definition. A prompt may ask you to save any, changes. 

mceclip13.png

3. In the Inspector window, the Hips node is set to Reference. Drag the Hips from the Avatar Configuration window on the left to the Hips Node in the Inspector window.

mceclip16.png

4. At the bottom of the node setup in the Inspector window click Apply. Then click Done to return to the Scene. 

5. The animation should now be correctly applied to the character. 

Mixamo.gif

 

2. Importing Vive Object Data

If you have recorded Vive Object data (see Object Tracking (HTC Vive)), you can import this data as FBX as well.

 

2.1 Import Object Model

For this workflow, a model of a box is used.

1. In your Unity project, go to GameObject > Create Empty to Create an empty GameObject

mceclip6.png

2. Right-click in your assets folder and select Import New Asset.

 mceclip0.png

2. Select your Model and select Import. The Model will now be available in the assets folder. 

3. Drag the Model as a Child the empty GameObject (this makes it easier, later on, to transform the position and rotation of the model separately from the animation). 

mceclip7.png

 

Import Animation FBX

1. Right-click in your assets folder and select Import New Asset.

mceclip0.png

2. Select your FBX containing Animation data and select Import. The animation will now be available in the assets folder. 

mceclip2.png

 

 

Create Animation Controller

1. Right-click in your assets folder and select Create > Animator Controller

mceclip3.png

 

2. Double-click the created Animator Controller to op the Animator window.

mceclip6.png

 

3. Drag the imported Animation from the Asset folder into the Animator window.

mceclip4.png

TIP: The FBX is read-only by default, making the Animation Curve not editable. To work around this, click on the arrow icon of the imported animation FBX. Then, duplicate the Animation (Ctrl+ D). 

mceclip8.png

Use the duplicate animation in your Animation Controller.

 

Add Animation to Empty GameObject

1. Select the Empty GameObjet (parent of the model) in your scene. 

2. Drag the Animation Controller into the Controller in the Inspector window (under Animator)

mceclip5.png

 

Adjust rotation and position of object

1. If necessary, you can adjust the rotation and position of the object by selecting the model of the object and change the position and rotation.

 

 

Was this article helpful?
0 out of 0 found this helpful
Do you have a question? Please post your question in our Community Forum