How Can I properly import the Blendshapes/shapekeys made on blender to unity game?

Hi everyone,

I’m struggling to export blendshapes (shape keys) from Blender to Unity without severe mesh distortion, and I’d appreciate your expertise. Here’s a breakdown of my pipeline and issues:


Problem Summary

  • Source Data: Motion-captured facial animations (recorded separately from body animations) merged with body animations in Blender.
  • Initial Approach: Used Blender’s Shape Key Editor with keyframed blendshapes.
  • Issue: Unity refused to play nicely with shape key keyframes, leading to distorted meshes (example: Image 3).

Attempted Solutions

  1. Bone Driver Workaround:

    • Wrote a script to convert Shape Key Editor keyframes into driver bones (second armature) controlling the blendshapes.
    • Expected Outcome: Avoid Unity’s Shape Key Editor incompatibility by using bone-driven blendshapes.
    • Result: Bone-driven version still caused distortion in Unity, despite working perfectly in Blender (see Image 1 vs. Image 3).
  2. Simplified Test Case (Cube):

    • Exported a cube with:
      • A) Shape Key Editor keyframes
      • B) Bone driver-controlled shape keys (no keyframes)
    • Result: Only the bone-driven cube worked in Unity. This suggested bone drivers should resolve the issue, but scaling this to the full character failed.

Current Symptoms

  • In Blender: Blendshapes animate smoothly (see Image 1).
  • In Unity (Static): Manually scrubbing blendshape sliders works (Image 2).
  • In Unity (Playback): Both bone-driven and keyframed animations break, causing chaotic mesh deformation (Image 3).

Troubleshooting Steps Taken

  • Export Settings (Blender 4.1):
    • Tried FBX with/without “Apply Modifiers,” “Bake Animation,” and separated mesh/animation files.
    • Tested exporting the armature as “Deform Only” vs. including all bones.
  • Import Settings (Unity 2021.3.3f1):
    • Adjusted rigging settings (Generic/Humanoid), enabled “Import Blendshapes,” and toggled “Resample Curves.”
    • Verified normals/tangents (Image 4 shows current settings).

Suspected Causes

  1. Export/Import Settings: A hidden checkbox or FBX version mismatch?
  2. Bone Driver Setup: Are driver bones improperly weighted or conflicting with the main rig?
  3. Animation Curves: Could resampling in Unity corrupt the data?

Requested Help

  1. Has anyone successfully imported bone-driven blendshapes from Blender to Unity?
  2. Are there critical FBX export/import settings I might have missed (e.g., specific FBX versions, “Always Sample Animations”)?
  3. Could normals or skinning data cause this? (Note: Manually scrubbing blendshapes works, so they’re technically “loaded.”)

Attachments:

  • Image 1: Blender working preview.
  • Image 2: Unity static blendshapes.
  • Image 3: Unity playback distortion.
  • Image 4: Export/import settings.

Thanks in advance! Let me know if you need more details. :folded_hands:


TL;DR: Bone-driven blendshapes work in Blender and a cube test in Unity, but full character imports fail. Suspecting export/import settings or driver bone conflicts. Need advice!




Greetings,

seems that this issue still happens in the most recent version of Unity. I had similar strugglings with blend shape controlled bones with various characters, for some reason, i managed to solve the issue only for my main character, but still having the issue in other characters.

What I did to solve it with my main character is unchecking the relative box, under the blend shapes in Blender (see screenshot) then re-importing the character to unity and worked.

But, seems that this same thing does not work for other characters.

Other stuff I tried is:

  • applying the blendshapes in blender works, and now when you import the character into unity the issue is gone, however, probably that is not what you want since the character will have the blendshapes applied as rest pose.

  • duplicate the head of the character, one with the blendshapes applied, then you could show or unshow each head during an animation. (yes, i know this is not really a solution but is the only stuff i found by now)

I’ll try to find a solution to this since i’m publishing a demo of my game soon, and i need to get rid of this issue.

Apologies for not could provide more help than this. I hope that it can be usefull for you.

Hey thanks for taking the time to reply! After several tests managed to find the source of all evil in this topic. The thing is that blender added a new toggle box on vertex data pannel (the one between constraints and material) called “Add rest position”, so anyone in the future that may have this problem, know you gotta check that box before exporting. (using blender 4.1) Hope y’all make it!