This article covers how to create and implement animated blendshapes in Maya.
Source Maya ASCII scenes with exported CRYENGINE files:
sdk_blendshape_maya_tutorial.zip (2.9mb) (Extract this to the Assets folder in your GameSDK folder. See above for the default location of this folder.)
(Do remember that you still need to have a modified "SkeletonList.xml" where you have added the skeleton *.CHR of this tutorial. Just in case you want to skip all these steps and want to open the character in CE Character Tool: SkeletonList.zip) (This should be extracted to GameSDK\Assets\animations.pak\Animations\. Note that you'll have to extract the animations.pak file first.)
Setup Your Content In Maya
Requirements for the blendshape scene in Maya:
All blendshape meshes (do not delete them!) must exist in your Maya scene and should be in the same world space location as the skinned base mesh. So, move your blendshape meshes on top of the skinned base mesh:
In some rare situations you may have set up your Maya as a Z-Up. If that is the case then for this tutorial you will need to reset it to a Y-Up. You must also set your scene to 30 fps and to centimeter when it comes to exporting:
In the tutorial scene the base head mesh was bound to some common joints (top spine, neck, head, jaw, etc.).
The top-level bound joint is "Spine04". Don't skin the "root" joint into your character mesh - it is for CRYENGINE export:
Notice the empty "SceneRoot" group and "root" joint created for CRYENGINE orientation:
Make sure the root node of the skeleton hierarchy has "zero" rotations - this means CRYENGINE interpretes it as Zero. Since CRYENGINE 3.8 and in respect to Maya there is a a properly orientated, empty "SceneRoot" group node and a "root" joint as the top-level node of the deforming skeleton. They have been setup with both looking forward with their Z-axes aligned to the World Y-axis and the their Y-axes aligned to the World Z-axis:
For each blendshape mesh you must create a joint in the origin and name it <BLENDSHAPE_MESH_NAME> + "_blendWeightVertex", e.g. "sdk_player_head_brows_raise_blendWeightVertex". The "blendWeightVertex" joints have been parented under the root joint for the skeleton hierarchy. (Use the script below in step 5!)
You must map the output range of the blendShape node weights from 0 to 1 to 0 to 100 of the translateX attribute of these joints. (Add an in-between MultiplyDivide node!)
Rather than manually creating the joints and connections you may want to use the Python script below for the setup:
Paste the script into a Python script tab of Maya's Script Editor and execute it just once. Then run the script by the command. REMEMBER: If you decide to use another head mesh then don't forget to replace the "sdk_player_head":
createBlendControlVertex( 'sdk_player_head', p=None, connect=True, debug=1 )
You should parent those blendWeightVertex joints to the CRYENIGINE "root" joint. However, you can also run the command (shown below) if the "root" joint has already been created:
createBlendControlVertex( 'sdk_player_head', p='root', connect=True, debug=1 )
A dummy quad/triangle polymesh object must be created and smooth skinned to a node of the skeleton hierarchy - it's best to select and include the top-most deforming influence as the only deforming joint.
Why do you need this dummy? Because this node only includes information about the skeleton hierarchy and thus keeps the model with skin and joint data separated from the skeleton. Hence, when you attach a "skin attachment" in CRYENGINE's Character Tool both model + skinning data are separated from the actual skeleton/joint (s) data. You could also attach the head mesh, then consecutively add more upper body apparel, etc.
Finally, you can add some blendshape animation. If you have animated the blendshape node beforehand, then you will notice the "blendWeightVertex" joints are moving when scrubbing the timeline.
Requirements before exporting to CRYENGINE: (applies to all character exports with ".SKIN" and *.CHR files)
A cryExportNode must be created for the skinned mesh with the BlendShape node. Use the "TOOLS" from Crytek shelf or create as shown in the screenshots below:
A second cryExportNode must be created for the skinned dummy quad/triangle mesh object:
In the cryExportNode of the skinned mesh with your blendshapes, set the export file type as "*.SKIN". Activate Eight Weights Per Vertex:
In the cryExportNode of the skinned dummy mesh, set the export file type as "*.CHR".
Add a proper material to the skinned blendshape mesh and perhaps a standard Phong material to the dummy object. Click the MAT.ED icon from the Crytek shelf to add a new material group, then add the shaders you have created. A dx11Shader has been added for the "sdk_player_head" mesh and a standard Phong for all the rest. The dxShader will be used later for the wrinkle maps in the wrinkle map tutorial for CRYENGINE.
Make sure you have saved the Maya scene (if you haven't already) before the next step. Press the EXPORT icon in the Crytek shelf and export both cryExportNodes:
In our case we bound the geometry to the skeleton in Frame 0.
In the Animation Export tab add a new animation for export. Type in a name for the animation (that will be displayed in CRYENGINE), plus the start and end frame positions. Then point the Exporter to the root node of the skinned character: this is the "root" joint in our case - you may also want to manually add the export folder (this should be a sub-folder of
Finally, press Export all Anims.
Note: Export Selected Anims will show up if you have an animation selected!
There are 4 files you have exported: a *.CHR file, a *.SKIN file the intermediate animation *.I_CAF file and perhaps the CRYENGINE *.MTL material file.
Now we have successfully exported out our assets, it's time to move to the CRYENGINE portion of this tutorial.