Blending Maya blendshape animations

This is my first try getting blendshapes into Unity and I’ve hit a wall.

I have no problems getting blendshapes to show up in Unity, I can manipulate the values between 0 and 100 and the blendshape is applied.
I also don’t have a problem getting animated blendshapes to play in Unity. When I make an animation in Maya I can import the mesh and the animation and have it play in Unity.

What I do have a problem with is blending between blendshapes. What I want to do is the following:

  • import a face into Unity with a neutral expression
  • make an animation in Maya using blendshapes where the character says “I am Niels”
  • make an animation in Maya using blendshapes where the character says “I’m 29 years old”
  • export those animations from Maya and import them into Unity
  • create an Animator with the animation clips “neutral”, “iAmNiels” and “iAm29YearsOld”
  • create 3 booleans in the Animator: “neutral”, “iAmNiels” and “iAm29YearsOld”
  • from a script, set one of the booleans to true so the accompanying animation starts playing.

The only way I can get blendshape animation to show up in Unity right now is if I export for example “I am Niels”, import that specific mesh + blendshape animation and use that specific mesh to play “I am Niels”. If I want to play “I am 29 years old” I have to use that specific mesh to play that specific animation.

The face with no animation has a blendshape node in Maya with several blendshapes. The animated faces have the exact same blendshape node with the exact same blendshapes. Every file, when imported in Unity, also shows all the correct blendshapes.

I was under the impression the same thing as with joint animation was possible. Where you import your character in a t-pose, import specific animations and then blend between them in the Animator.

Am I overlooking something simple or this is approach just not possible?

Well, as long as you just want to crossfade shape animations and aren’t using joint-based animations with it the following should work (I can’t get them to work together no matter what I try):

In Maya:

  1. Create the Blend Shapes under the same node. (i.e. select all blendshape meshes, then the original mesh, then Create Deformers > Blend Shape Option > Advanced > Deformation Order: Front of Chain > Create)

  2. Keyframe your animations. Because of 1. you should have all of the blendshape sliders available in the same BlendShape node.

In Unity:

  1. Import your model from Maya. Use either the maya file or an fbx. Dae should also work.

  2. Create an Animation Controller. Add a boolean Blending, and a float BlendAmount to the base layer.

  3. Drag on your idle animation so it is the default animation. Right-click > New Blend Tree.

  4. Specify what keyframes your animations are set to in the inspector for the model you imported.

  5. Double click the blend tree node. Add a motion field for each animation you want to blend between. Drag each of your animations into the motion fields from the imported model.

  6. Define the blend curve for your animations based on the value of BlendAmount.

  7. Double click the background of the Animator panel to get back to the base layer. Right-click your idle animation, and create a new transition to the blend tree. Trigger the transition by setting the boolean Blending to true. Repeat to create a transition from the blend tree back to the idle state if Blending is false.

  8. Do what you want with it in code. If you leave the default blending values, BlendAmount = 0 and Blending == true will result in the first animation, and BlendAmount = 1 will be the other. Ramp it during runtime using Lerp to get a transition.