Avatar Morph Animation in Blender

Description: in this avatar tutorial we take a look at making a simple custom avatar expression for the IMVU using head ‘morphs‘ that animates or change the avatars face that can be exported as an *.fbx from Blender, imported into IMVU Classic and IMVU Studio, then set up as a triggered action.

Download: Face Morph Starter File for Blender | Example File.

Design note: in Blender Morph Targets are called Shape Keys. They allow for the creation of animation without using an underlying skeleton. They work by storing coordinates, one for a mesh in its default state, another after modification, the difference then being controllable using a property slider to shift between each to varying degrees.

• • •

Shape Key Starter File

To create shape key/morph animations the Shape Keys Starter File for Blender is needed. The file includes a standard version of the female or male avatar, without skeleton (armature), assigned a set of Shape Keys [2] (listed in Object Data Properties [1]) that can be used to modify the avatars face [1] creating custom expressions or animations (static poses or animated sequences).

Design note: shape keys/morphs differ from general avatar animation in that they don’t use a skeleton to deform the mesh. As a result sequences made for one avatar may not work correctly for the other due to differences in shape between the two.

Shape Key (morph) Starter File
The Shape Key Starter File includes an avatar, female or male, which is set up with a series of Shape Keys [2] (morph targets) – listed in Object Data Properties [1]. Each ‘key’ stores a corresponding deformed mesh ‘shape’ that can be blended from the unmodified default version to whatever is referenced by the shape key itself.

Shape Key Editor

To animate, switch the Action Editor (Dope Sheet) to the Shape Key Editor [3] and expand the Summary heading in the Channel [4] listing to display all the available Shape Keys. Move the timeline scrubber/slider to a key frame and then change the Value input field for the appropriate key to ‘pose’ a particular area of the avatars face. This drops a Keyframe Marker [5] into the timeline storing the pose data. Repeat as needed to create an overall expression.

Using the Shape Key Editor to animate the face
In the Shape Key Editor [3], the available shape key Channels [4] can be shown expanding Summary, after which a value can be set, with pose Marker automatically placed in the timeline, at the scrubbers location [5].

Action Sequence Proxy

Before exporting ensure a ‘proxy’ Action exists that corresponds to the duration of the Shape Key sequences i.e., if the facial expression is 20 frames long (frames 1 through 20), an Action must also match this, also being 20 frames. To do this switch the Shape Key Editor (back) to the Action Editor and click + New to create a sequence. Make sure the avatar’s head is selected and position the timeline slider to correspond to the shape key animations start point. From the Object menu select Animation, Insert KeyframeObject » Animation » Insert Keyframe. Repeat for the end frame to complete the action.

Design note: Actions are necessary because IMVU pulls animation data from the tracks this generates in the FBX – in this context Actions don’t need to include any actual animation information as their purpose is to act as a proxy for the Shape Key sequences length or duration.

An Action is needed to export a Shape Key sequence
Switch (back) to the Action Editor [6] and create a new sequence [7] to act as a proxy so both Blender and IMVU know some animation data is included – resulting FBX files may be blank without this step.

Shape Key Export

Once a corresponding proxy Action is available export the Scene from File, Export, then select FBX (.fbx)File » Export » FBX (.fbx). In the File View that opens, on the right; under Include ensure Selected Objects [8] checkbox is cleared (setting disabled); under Armature the Add Leaf Bones [9] checkbox is cleared; under Bake Animation that both NLA Strips [10] and Force Start/End Keying [11] checkboxes are cleared. Change the file name and save location as required and click Export FBX.

Export setting for Shape Keys
Exporting a Shape Key animation to FBX is similar to other types of item with the exception that two Bake Animation settings must be disabled, NLA Strips [10] and Force Start/End Keying [11].

Morph Import – Classic

Shape Key sequence import is similar to the more typical Action sequence based animations (XAF). To import the FBX, derive a new product clicking the Derive New Product button in Create mode and select the appropriate item as the derivation, typically the Empty Derivables (Female/Male Clothing), or the Empty Mood item (PID 10945930). In the importer ensure Apply scale is set to 0.01 [12] and checkboxes for all mesh and materials are cleared [13] (disabled); only morph animation listed under Morphs/Actions should be selected [14]. Click the Import button to complete the process.

Important: for morph animation derivation there isn’t a ‘blank’ or ’empty’ base avatar, the face always animates by default unless something is overridden.

IMVU Classic import settings
Exporting the contents of a Scene from Blender means IMVU will import meshes and materials alongside the animation. As these are not needed they can be discarded during the import process by clearing their respective checkboxes [13], the morph being the only component to bring in [14].

Morph Import – Studio

For IMVU Studio, to import a shape key/morph animation file (FBX), click Create and select a base derivable, e.g. Empty Female Clothing, and click Derive. Once the editor is open click the hamburger icon (☰) then select Edit, Import☰ » Edit » Import. In the standard file browser browse to, select and open the FBX to import. Studio will present the FBX Import Settings dialogue that initially shows the files contents, skeletons, meshes, materials and animations that might be present. Click the white Set up FBX button and on the next page make sure to set Scale to 0.01 [15], and if shown deselect any meshes [16]. Click Next [17]. Deselect any materials then click Next. Make sure the shape key/morph animation is shown and selected then click Review to see what’s to be imported. Click Import to complete the process.

IMVU Studio import process
For IMVU Studio FBX import is a ‘walk-through’ process. With a base derivable in place import the FBX file and set the Scale to 0.01 [15], deselect everything [16] except the morph animation whilst stepping though the process [17].

Morph Action – Classic

To actually see or use the morph animation it needs an action so once the data has been imported click the actions tab then + Add to create one. Depending on how the animation is to be activated set the Trigger to be a word or phrase for manual activation, or type stance.Idle to start on load [18]. Set Type to Avatar and select an appropriate option for After Playing (random, same, cycle). This sets the base parameters of the action. To finish the action, in the Morph Animation section of Ensembles below select what is now an XPF file from the drop-down to link the animation itself [19], then in Morph Frame Controls set the # loops, 0 for infinite, and Loop start and end to set a frame range where necessary, e.g. Loop start 1 and end 20. Click Apply Changes to finish and play the action based on the trigger used.

Design note: optionally Composition can be set to Replace and Disable Gaze enabled (checkbox) to ensure the default animations don’t interfere with the new addition unduly.

IMVU Studio import process
Once the FBX data has been imported it needs to be set up as an action. Set the Trigger and product Type then select the morph and assign basic playback parameters, the # loops and Loop start and end frame range.

Morph Action – Studio

To set up an action in IMVU Studio, once the FBX has been imported into a derivable and is ready for use, on the left side and in Component click the clapper-board icon (‘actions’) then + [21] to create a new instance. To the right-hand side under the Inspector type a Name/Trigger, e.g. “goggly” then click the + button to the right of Ensembles [22]. The Ensemble properties panel appears [23]. Under Morph Animation select the Asset to be played, the (now converted) XPF file listed and set the sequences Duration options; Start, End and Loop. Finally set Amplitude Scale between 0 and 99 to affect playback – 0 ‘mutes’ the sequence, 99 plays it as designed in Blender. Click Apply to complete.

IMVU Studio import process
Once the FBX data has been imported it needs to be set up as an action. Set the Trigger and product Type then select the morph and assign basic playback parameters, the # loops and Loop start and end frame range.