Exporting a Character Head

Obsolete. This documentation refers to either a deprecated system or an unsupported function or feature.

Exporting a Character Head with Morphs

Setup in 3DS Max

This tutorial shows you how to export a head with morph targets, by using 3ds Max.

Preparation

  1. Assign a skin modifier to the main mesh, with the neutral facial expression.
  2. Now, add all the morph targets to the skin modifier. Later, you can control these morphs in the Sandbox Facial Editor.
  3. The final step is to add the skin modifier. Add the Spine3 and the Head bone to the skin modifier. These bones are needed to rotate the head in the engine. Ensure that they have been properly weighted.

Export Settings

  1. Go to the CryENGINE Exporter to export the Head.
  2. Add the Head, with the modifiers, to the Export lists.
  3. Select .chr as the file format. If you want to export the Head with a filename that is different from the 3ds Max filename, select the Custom Filename check box and click the button (...) below it to choose the filename.
  4. Finally, click Export Nodes to export the Head.

Optimization

Morph Target Min Offset displays the minimum offset value that a vertex needs, in order to be exported. If you use a very low value, like 0.00000000001, the .chr file size will be very large because every vertex in every morph will be saved. If you use a high value, like 5, none of the vertices that have a value smaller than 5, will be exported. The recommended value is 0.0001, which works well in most cases.

Note: If you see only one digit after the colon, you can go to the Customize > Preferences > General tab. There, you will find the Spinner properties. Set the Precision to 5 decimals.

The last thing that you have to do is to check whether Bip01 exists in the Bone Export list or not. If you receive error messages related to the sorting of the bones, you can select the Sort Bones check box.

Setup in Maya

This tutorial will guide you through exporting a character head from Maya to the CryENGINE assuming that you have a base mesh with multiple morphs that have the same topology.

Preparation

  1. Select all of your meshes with the neutral mesh being the last selected.
  2. Now open up your Blend Shape window and click 'Create Blend Shape' and be sure to test your morph by adjusting the slider and the neutral mesh deforms correctly.
  3. Lastly be sure to bind your skeleton to the neutral mesh and paint the weights.

Export Settings

  1. Open up the CryENGINE exporter window and the Material Editor.
  2. In the Crytek Exporter window; click Add Attributes then choose this export node as a .chr with naming depicted below:
  3. Be sure to assign your materials accordingly and add them to a Material group.
  4. Finally you may click 'Export Nodes' which will export your head.

Exporting a Head with Morphs

With this example, you will learn how to make a simple and morph-based facial setup. The Facial Editor allows you to combine and use morphs, bones, and attachments in various ways.

Create Morphs

The first thing you need is a set of morphs.

  1. Example (Base model)
  2. Example_mouth_open_01 (relaxed open; half open)
  3. Example_mouth_open_02 (wide open; wide open) - these two will later be combined to a single motion by using a nonlinear expression.
  4. Example_mouth_wide
  5. Example_mouth_narrow
  6. Example_mouth_close

Note: Ensure that all the models have the same pivot.

  • Ensure that all the models have the same vertex count/vertex IDs.
  • Whichever morph you can display in 3ds Max, will be displayed in the game as well. If 3ds Max can't display it, the game won't either.
  • The exporter will export only simple morphs. Non-linear morphs won't be exported. However, non-linear morphs can be set up within the Facial Editor.
Setting Up the 3ds Max Scene

  1. Add a Morpher modifier.
  2. Add the morphs: Be aware that the 3ds Max Morph modifier is limited to 100 morphs and its use is not very easy to use.
  3. Make sure that you frequently reload the latest morphs or select the Automatically reload targets check box. The exporter will export only the morphs version that is stored in the Morpher modifier.
  4. Click a morph to display the full name if the dialog at (2) is too small to display the whole name.

Check the .chr file. The easiest way to check if morphs are working is to use the Character Editor. Open the model and use the Animation panel to fire certain morphs.

  1. Open the Objects folder to see all the available morphs.
  2. Click a Morph to display it for a couple of seconds.

Create the Expressions Folders

Right-click the Root folder and select New Folder. Call this folder Mouth. It will contain all the expressions that specifically control the mouth area.

Expressions

Right-click the Mouth folder and select New Expression to create a new expression inside this folder. Call this expression, Mouth_x. The x stands for the x-axis of the joystick that you will create a little later.

Adding Morphs

Now, either drag the desired morph to the expression or use the text field. Most often, it's easier to use the text field, especially when an expression set starts to grow.

For typing in the name, right-click the Mouth_x expression and select New Expression again. This time, type in the name of one of the morphs: Example_mouth_wide. Repeat the same step with the Example_mouth_narrow morph.

4. Tweaking the Expressions

Right now, you have two morphs. Both are linear and will be displayed at the same time when the expression value (1) is at +1. At the same time, you will get a combination of both negative values at -1. This is something that you don't want.

In this case, Example_mouth_wide and Example_mouth_narrow are opposing morphs and should never be displayed at the same time. Using an expression like this will make sure that either one or the other will always be used, but never both at the same time.

To tweak the expressions:

Right-click the spline (2) and select Spline, instead of Linear. This will convert the line to a curve. Double-clicking the spline will create a point on it. With the help of this, you'll be able to tweak the curve in various ways.

Use this tool to modify the curves, as shown in the following image:

Now, the Example_mouth_wide morph will be active only when the expression value is negative. Example_mouth_narrow will be active only when the expression value is positive.

Repeat the whole process with Example_mouth_open_01 and call the expression, Mouth_y.

It will now look like this:

Non-Linear Expressions
You will use the arch-like behavior of the jaws to create a non-linear expression.

So far, you have a starting morph (base) and a destination morph (Example_mouth_open_01). This creates a linear motion, which is atypical for any rotating joints, like the jaw. This problem can be solved by adding another morph in between or at the end.

Theory:
Arc movement of the jaw:

Linear:

Non-Linear:

Creating a Non-Linear Expression

Add the Example_mouth_open_02 morph to the mouth_y expression (1).

Arrange the curves like in (2) and (3). At 50% of the expression, the Example_mouth_open_01 morph will be displayed for 100%, while Example_mouth_open_02 will not be displayed. At 100% of the expression, Example_mouth_open_01 will not be displayed, while Example_mouth_open_02 will show up till 100%.

The curves are slightly offset from the middle; this produces a smoother blending at the cost of a little negligible accuracy. Make sure that you've saved the expression file. This file needs to be referenced in the .cal file.

Wire It

As you've got the basic set of a simple mouth expression together, you have to wire everything up in the Facial Editor to use it. The expressions (1) need to be listed in the sequence of the sequencer (2). From there on, the expressions can be linked to a Joystick (3).

Right-click the Root folder in order to create a new folder. Call this folder "Mouth".

Using folders will enable you to key certain segments at once and logically separate certain parts of the face from each other. Drag both the expressions to the Mouth folder in the sequencer.

Each expression in the sequencer gets its own curve. From now on, the expression can be animated.

Richt-click the Joystick menu and create a new Joystick.

You can drag its borders to change its size. Use the joystick options to modify its appearance.

Select an expression in the Sequencer (2) and right-click the Joystick to assign the expression by using the Set Horizontal/Vertical Joystick Channel.

Repeat this with the other expression.

Joysticks will work only when a key is existent at the current point in time. The Joystick's cross will be marked red if a key already exists. Make sure that you are either on key or that Auto-Create Key has been activated.

Now, you will be able to move the face by using the Joystick controls.