Customisation :: Adding a Facial Expression - enimaroah-cubic/Sb3UGS GitHub Wiki

A new blendshape is created and added as described in Morphs or Blendshapes described. Add_expression_01

Add_expression_02

The new blendshape here is at index 81. We need to find a free slot in FaceBlendShape MonoBehaviour. The list of named expressions for the Character Maker is in abdata\custom\customscenelist\00.unity3d in MonoBehaviour cus_m_ptn.

Add_expression_03 - chara_maker_mouth

We add a new line, in this case with "40, M exp 40" and extend all arrays in MouthCtrl. Index 40 will be used for each mesh when the new expression will be selected in game. In this case there are more entries right from the start. Those exceeding entries are unused and can not be selected in the Character Maker.

Add_expression_04 - FaceBlendShape_Mouth_meshes

Here we put our index 81 for the new expression. The Close expression is the shown when the slider in the game is fully left. And Open is the right most position.

Add_expression_05 - FaceBlendShape_Mouth_entry40

The studio doesn't have the same gui. It simply shows the new index 40.

Add_expression_06 - result

Since we did nothing about the other meshes in MouthCtrl, and pulled back the jaw related vertices in the new expression, the tongue now pokes through. In the Character Maker the chin is the fifth slider in the third section - shown value 11.

In abdata\list\customshape.unity3d is the definition for the sliders. In the first column is the slider index. Each line is for one Transform, and for some sliders there are several lines.

Add_expression_07 - customization_mask

In this case the chin has only one Transform cf_J_Chin_Base. The following columns are translation(X, Y, Z), rotation(X, Y, Z) and scaling(X, Y, Z). A value of 0 indices that the component is unused, 1 means that it is used. In this example only translation for Z is used.

In the head's AB we find TextAsset cf_anmShapeHead_00.

Add_expression_08 - cf_anmShapeHead_curves

All columns form nine curves for translation(X, Y, Z), rotation(X, Y, Z), scaling(X, Y, Z) with 25 keys for the Transform in the first column. If the line would be broken for each animation key, it would look like this (meant for understanding only. You don't have to do this for modding.):

Add_expression_09 - customization_curve

The tongue mesh with its morphs imported, the MouthCtrl's corresponding morph t00_sinken03_op fully used, the curve from above keyed, then the timeslider is set to 11 (slider value from chin) * 24 (last key index) / 100 (slider max for chin) = 2.64 and we see the tongue poking through like in the Character Maker.

Add_expression_10 - simulated

Special cases for toon eyes

abdata\list\characustom\00.unity3d has the policy for all heads and adding a new expression in it for only one head would cause problems for the others. The toon eyes with gageye meshes use a single morph for the face mesh at index 21. image