Exporting Animations and Blend Shapes into Unity Pt.1
Finally got animations to work in unity today, it felt amazing. Only one problem though...Blend shapes wont export with animations.
But it’s ok! today I’ve got another little tutorial on how to give your character that extra spark, by showing you how to import blend shapes into unity!
There’s nothing like seeing a lively dance animation, only to watch the unblinking, emotionless face of the character stare back at you. For this tutorial, we’ll use a simple Blinking blend shape.
Create your blend shapes and apply them to the object you want to deform.
If you have an animation, bake it out to the bones of your character by selecting all of them in the outliner.
Delete from your scene everything you don’t want to end up in unity (including the spare heads you had for the blend shapes) and delete all Non-Deformer History. This will prevent a potential error when we export.
Select your entire character in the outliner and go to “Export Selection”
In the options on the right hand side make sure animation is ticked. You wont need Bake Animation selected since we’ve already done this, the only other thing we need to check is that all the options under Deformed Models is selected, especially Blend Shapes. Export as an FBX, chances are you’ll get a few errors, but this is fine.
Open up Unity.
Import any textures you may have, then throw in the FBX you saved out. Select the Model. There are a few options we need to select to get animations working. First, under the Model tab, correct the scale and make sure “Import BlendShapes” is selected. Apply the changes.
Under the Rig tab, select the “Animation Type” drop down box and select “Legacy”. Apply the changes.
Under the Animations tab, select the clip and rename it to suit the animation. To have the animation loop, just select the “Loop” options from the “Wrap Mode” drop down box. Apply the changes.
To see if the animation is working the way you intend, you can click the little play button above the preview window on the bottom right hand side.
Now, if you drag the character into the scene and press play, you’ll notice, of course, that the blend shapes wont work, we’re going to have to add them using unity’s animation window.
Select your character, you’ll see the animation show up in the window, however, we cant edit this since the animation is a “Read-Only” file. To fix this, we need to make a duplicate of this animation.
Click the arrow on your character in the Project window and scroll down to find the animation, select it and press CTRL&D, a duplicate of the animation will appear. Rename this appropriately.
Select your character in the viewport and under the animation Component, change the animation to your duplicated one.
Continued--