# cryTools: CryMorphTools

## Tutorials

Here are some tutorials on using the MorphTools:
Mirroring Morphs and Deformation (without altering point index)
Transferring Morphs Between Characters
Generating Head LODs with Morph Targets

## Facial Tools

Please refer to the tutorials above about how to use these tools.

Auto Generation/Extraction

When you press 'Load Morphs from Selected, the text at the top changes to echo the number of morphs loaded fromt he selected head/mesh. When using the number of morph targets rigidly setup for the Crysis pipeline, you can ignore 'dirty output', when you bake out morphs, they will be arranged by morph set and colored in the fashion that you are used to. The baked out head meshes will also be named with their respective morpher name.

Enable Dirty Output - This means that you are exporting a head or object that does not use the rigid preset structure of the Crysis facial pipeline. Dirty Output is used when baking or adding an arbitrary number of morphs to a selected head or object with a morph modifier (useful for baking out vertex animation, an example in Crysis would be the parachute). The morphs created are named using the names fromt he morph target in the morpher modifier, and they are randomly colored.

Organize (Align to helpers) - will move the heads created to artist specified locations, these locations are marked by helper dummies with the morph name prefixed by ‘Dummy_’. The overflow (targets baked out that have no corresponding helper) will default to a row up top, like the ‘dirty’ output mode.

New Layer: - Enter text defining the name of the layer you would like the morphs baked to.

Add Selected Morphs to Picked - This will ass all selected morph targets to your picked head. The morphs will be named after the meshes that created them.

Add organized morphs to head - will dump all the morphs you created (even overflow) to a new head

Delete Faces from Targets - You can load a selection of faces and then delete those same faces from any number of selected objects. All objects must share the same point index. Useful for deleting faces on multiple heads. (Used in Crysis to remove the NK heads, but allow eye animation to be played inside the Asian Nanosuit helmet.)

Mirror Eye Animation - This will mirror the procedural eye calibration animation from Left to Right or Right to Left. This animation is used to bake out eye deformation targets that are later procedurally driven by look IK. The bone eye rig must be present in the scene to use this tool.

Tech Note: Using this and many other facial tools (like non-dirty output above) requires strict adherence to the CryEngine2 Facial Pipeline, these eye bones have specific names and those names are used to locate and mirror their animation.

Morph Transfer - This is used to transfer morphs between heads with unlike topologies/ point indices.

## Sync-Collapse by Location

This tool collapses points by location instead of point index, useful for creating head LODs and loading those collapsed point sets onto other heads. Unfortunately, it is no longer supported. Though the code is there if you have the need and want to check it out. Here is an image explaining the basic concept, and here is what the marking looks like.
Hide Collapsed - will hide the points you collapse as you go

Collapse Variations as I Work - will apply your collapse to all head variations as you work

Mark Collapased Verts - will mark the verts you have collapsed on all the head variations

Here is the basic workflow:
1) Select the main head you will model on and click ‘Select Main’
2) You ‘collapse’ verts on the main head (two at a time) to make an LOD, then click ‘Save Collapse Data’
3) This then saves an ‘.i2l’ file with your changes.
4) Open a file with other heads (different character head)
5) Select all the heads and click ‘Select variations’
6) Then click ‘Load Collapse Data’ and select your ‘.i2l’ file
7) Then click ‘Apply’.

## Pose-Driven Morphs

### Head/Neck

Pose-driven morphs allow you to set different ‘pose vectors’ like ‘look_up’, ‘look_down’, ‘look_left’, ‘look_right’, and so on. Each of these directions, can be associated with a morph target, so when a characters head rotates left, the geometry is cleaned up with a nice morph shape that an artist sculpted just for that position.

Tech Note: As of right now this only works with Skin. But we have a few heads using the Skin modifier, and we can convert Physique to Skin.

Usage: First you click ‘Select Character Head’ which will then change to HeadName + ‘Head Loaded
When you select a pose vector, the ‘Create Pose Shape’ button now becomes enabled if a pose shape associated with this vector is not already present. When you click this button it will make a head snapshot in the position of the vector. Note that we are defining the vectors, and that this system does not allow for an arbitrary number of vectors and associated morphs (in engine). Here is what it looks like if you click ‘Create Pose Shape’ for each vector:

You can now edit any of these objects. The objects are named: Look_Up_sculpt, Look_Down_sculpt, Look_Right_sculpt, Look_Left_sculpt, Tilt_Left_sculpt, Tilt_Right_sculpt
If you click ‘Add Pose Shape To Morpher’, the tool will generate a relative shape with all of the skinning data culled from it, and apply it to the loaded head.

The morphs are added to the Morpher in the following channels:
1) Look_Up
2) Look_Down
3) Look_Right
4) Look_Left
5) Tilt_Left
6) Tilt_Right
You can work on a corrective shape, then click ‘Add Pose Shape To Morpher’ and it will apply your work over the associated channel so that you can test as you go. If you click ‘Extract Relative Pose Shape’, the tool will spit out a relative morph shape in the position of the original character head with your sculpt changes (minus all skinning-related transformations). That looks like so:

Above, some points on Look_Left_sculpt have been tweaked to give the neck the volume lost in the skinned rotation. The relative shape was extracted and we now see it on top of the Morrison head (pink, and looks like he has a goiter).

Facial Editor Setup:

So you just set the targets up like so, ignore the naming here.

### Fleshy Eyes (Auto-Created)

This works much the same way as the tool above, but the eye directions drive a special eye rig. The look directions are already setup, the character just needs to be imported into this file, you can then refit the bones to his eyes and weight them.

This rig is located in the following path:
Tools\maxscript\ref\fleshy_eye_rig.max

## Baking Tools

Bake Deformation to Morphs
This is a simple tool, you load an object that has a deformation applied over time. You then set the frames in which you want the deformation baked off to morphs, then the number of morphs you would like it baked to.

## Diagnostic Tools

Morph Manager
This is a better morph rollout that comes from the Max SDK/help docs
Generate Morph List
This spits out a list of the morphs for a current object to a list in the Listener. If 'Include Channel Numbers' is checked, channel numbers will also be printed.