Mixamo animations with Blender character in Unity

This blogpost will hopefully provide some insight into how you can easily rig a character in Blender, import it to Unity and add Humanoid animations from Mixamo to use with the Mecanim system.

If you already have a rigged character or want to use one from Mixamo you can skip the first part about Rigging in Blender and Exporting from Blender and go directly to Importing Character to Unity.

Rigging in Blender

First off, we will set up a simple rigged character in Blender. A good practice when modelling humanoid characters is to make sure the character is modelled in a T-Pose, i.e. arms out to the side and legs down:

T-Pose

Now we can start rigging. A good way to save some time on humanoid characters in Blender is to use the Meta-rig that comes with the Rigify add-on. To enable this add-on, go to File -> User Preferences -> Add-ons -> Rigging (or search for rigify) then apply the check-box and press Save User Settings:

BlenderUserPrefsRigify

It is good practice in Blender to keep the pivot point centered, so press Shift+S, then Cursor to Center (new objects in Blender get the pivot point from the cursor position):

BlenderCursorToCenter

Now go to Add -> Armature -> Human (Meta-rig). This places basic human skeleton in the scene, with pre-named bones positioned roughly where we want it (press Z to toggle wireframe view):

BlenderUnnecessaryBonesAndWireframe

However basic it may be, this rig is way more complex than we need. For this example we will remove all the face and finger bones, as well as the breast. :

BlenderBonesDeletedAndWireframe

With unnecessary bones out of the way, we can start positioning the bones to fit our character. A good tip here is to use orthographic camera (num 5) and switch between front view (num 1), right/left view (num 3 ctrl + num 3 ) and top view (num 7) as needed. Make sure to have a little bend on the arms and legs, as this will make it easier to extend the rig later or make a ragdoll in Unity (I mean, why wouldn’t you! Ragdolls are awesome!). A tip before you begin is to apply X-Axis mirror in Options. Also make sure to zero out any bone “Roll” in the arm bones:

BlenderRiggingMirrorAndBoneRoll

BlenderBonePlacementFrontBlenderBonePlacementRightBlenderBonePlacementTop

When the bones are positioned correctly, it can be worth your while to run through the bone chains and check the names. This is not strictly necessary, but the Meta-rig name the hip-, neck- and head-bones are all called “Spine”, which is not ideal:

BlenderBoneNames

Now that the bones are correctly placed and named, we can start skinning. This can be a bit tedious if you have a high-poly, complex character (pro-tip: unless you are part of a AAA game studio, go low poly!), but luckily the character in this example is super easy to skin!

Start with parenting the character mesh to the armature: First select the character, then select the armature, then press ctrl + p and choose one of the three autoskinning options under Armature Deform: with Empty groups, with Envelope weights or with Automatic weights.

Generally, I recommend Empty groups or Automatic weights. Empty groups makes vertex groups for each bone but leaves all the vertex weights at zero, i.e. nothing moves with the bones. Automatic weighting also makes vertex groups, but automatically applies weights to the vertexes.

Automatic is good for organic characters, but for this simple blocky character it is better to go for Empty and apply all the weights manually:

BlenderParentingForSkinning

When the character and armature are related, we can now select the character and see that the Vertex Groups list has been populated with the bone names. I like to start at the top of the list and move down. With the character selected, go into edit mode, then select the hips vertex group. Then select all the vertices that should move with the hips and press the Assign button. Repeat these steps for all the body parts:

BlenderSkinningAssign

Exporting from Blender

When the skinning is done it is time to export the rigged character into Unity. Make sure to select both the Armature and the character mesh, then File-Export-FBX(.fbx). Match these export settings:

BlenderExportAsFBX

MAIN

BlenderFBXOptions_Main

GEOMETRY

BlenderFBXOptions_Geometri

ARMATURE

BlenderFBXOptions_Armature

ANIMATION

Leave the animation settings as is.

Importing Character to Unity

Unity needs to know that this is a humanoid rig. To do this, simply select the fbx character in the Project view, then in the inspector choose Rig, then Animation Type Humanoid and hit Apply:

UnityImportSettingsHumanoid

Mixamo animations in Unity

Getting animations from Mixamo is pretty easy, but to make them work on a Blender armature you have to do a little bit of trickery. First off, make an Adobe account (if you do not already have one) and log in to Mixamo.

Then, choose a character. I’ve chosen the Y-bot character for this example, but doesn’t really matter. Go to animations and select the T-pose animation. This will serve as a kind of “bridge” to get animations from Mixamo to work on a Blender rig in Unity. Then press the download button and in the download settings choose Format: Fbx for Unity, Skin: with skin, leave the rest as is then Download:

MixamoDownloadT-Pose

Import the fbx file into Unity. In the Rig settings do the same as you did with the Blender Character:

UnityImportSettingsMixamoTPose

Now you can download an actual animation from Mixamo. Find a suitable animation and download, but this time, choose Skin: without Skin:

MixamoDownloadAnimation

In Unity, select the fbx-file, under Rig select Humanoid. Then Avatar Definition: Copy from other avatar. In Source select the Avatar from the T-posed character you downloaded from Mixamo:

UnityImportSettingsMixamoAnimation

Then, depending on the type of animation, you will most likely spend a little time tweaking the result in the Inspector Animation tab (see the section on LoopingAnimationClips in the Unity Manual for more explanation on these settings):

UnityAnimationSettings

Finally, put the animation in an Animator and play away:

UnityAnimationResult

 

 

 

,

4 responses to “Mixamo animations with Blender character in Unity”

  1. Irene Avatar
    Irene

    Thank you so much for this!!
    I have been going crazy trying to figure out how to make mixamo animations to work in Unity with Blender models! Never thought of downloading a T-posed skinned animation and then non-skinned animations! Worked perfectly!
    All i then had to do was bake into pose the Y component to keep the animated character from sinking into the ground!
    Virtual beers are on me!

    1. gennon Avatar

      Great to hear someone else has use for this! 😀 *drinking virtual beer* Cheers!

  2. GuQin Avatar

    Awesome blog! Do you have any hints for aspiring writers? I’m hoping to start my own blog soon but I’m a little lost on everything. Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely confused .. Any suggestions? Appreciate it!

    1. doccers Avatar
      doccers

      Thank you!

      It certainly is a jungle out there, but even though there are a bunch of options I believe most of them deliver pretty much the same service beneath the hood.

      What you usually end up paying extra for is “ease of use” and being able to display a custom URL. While that may be worth it for you, I would recommend starting with a free wordpress account and look at some tutorials on the basics. Youtube is flooded with them, so start there. If you then feel like WordPress may be the right choice for your project and would like some more complete tutorials, you can perhaps try a discounted tutorial from somewhere like udemy.com.
      Then go grab some inspiration from other websites/blogs you like and create your own version.
      Keep it simple and try to get someone you trust to help you with constructive feedback on your layout and writing before publishing.

      This is pretty much the way we did it anyway 😉 I hope this helped you a little. Good luck!