Help—My Blendshapes Aren’t Working!

Every now and then, I get emails, comments, tweets, or some other communication asking me for help getting blend shapes into Unity with my (now quite old) Maya Extensions package. It’s understandable because the tool I put out was very fragile for a lot of reasons (many my own fault), and I simply haven’t had the resources to finish up and distribute an update. However, because Unity 4.3 now natively supports blend shapes, I have been advising everyone who only needs blend shapes to simply update to 4.3.

Unfortunately, due to errors in Autodesk’s FBX SDK, you can run into a bunch of problems in Unity if you export your models with anything newer than FBX version 2011 (e.g., blend shape data importing incorrectly, animation curves for blend shapes not importing). Although you can of course work around this problem by manually exporting your models as FBX and selecting the appropriate version, many people opting to use native Maya files (.mb or .ma) have instead begrudgingly used older versions of Maya. (While I have no personal experience with it, I’ve been told it’s a similar situation for Max users.)

Fortunately, there’s a fix you can implement to work in your latest version which at least resolves all problems I have encountered. Namely, you can make the following modifications to the FBXMayaExport.mel script in your Unity.

  • Mac: /Applications/Unity/Unity.app/Contents/Tools/FBXMayaExport.mel
  • Windows: C:\Program Files (x86)\Unity\Editor\Data\Tools\FBXMayaExport.mel

First, lines 43-48 read like this:

if (getApplicationVersionAsFloat() >= 2013)
{
    print "Setting FBX version to FBX201200.\n";
    // Ensure we are using a version of FBX that Unity can currently support
    FBXExportFileVersion FBX201200; 
}

They should be this:

if (getApplicationVersionAsFloat() >= 2012)
{
    print "Setting FBX version to FBX201100.\n";
    // Ensure we are using a version of FBX that Unity can currently support
    // and for which blend shape animation curves are not broken
    FBXExportFileVersion -v FBX201100; // NOTE USE OF -v FLAG
}

Second, line 96 has this command:

FBXExportHardEdges -v $exportNormals;

My understanding is that the only purpose of this command is to force physical separation of vertices with multiple normals for old versions of MotionBuilder that could not support multiple normals for a single vertex (see here and here). As such, I have encountered no adverse effects from changing it to the following:

FBXExportHardEdges -v false;

Hopefully these changes work for you, too! Let me know in the comments if you experience different results.

3 thoughts on “Help—My Blendshapes Aren’t Working!”

  1. Are you experiencing similar problems in Max? I’m not a Max user, but a glance at the FBXMaxExport.ms file indicates you could remove lines 97-101 (if (exportNormals) do...) and replace it with the following lines:

    if ( ver[ 1 ] >= 14000 ) do
    (
        FBXExporterSetParam "FileVersion" "FBX201100";
    )

Leave a Reply

Your email address will not be published. Required fields are marked *