Proxy meshes

Adding your own proxy mesh
The definition of the two current proxies are located in the files forsaken.proxy and Rorkimaru.proxy in the data/templates/ folder. The files consist of several sections:

Mesh without UVs:
1. Association of each proxy verts with a triangle in the original mesh.
2. Proxy faces. Each face is a list of the face's corners (three or four) vertex numbers.

Mesh with UVs:
1. Association of each proxy verts with a triangle in the original mesh.
2. Proxy UV coordinates.
3. Proxy faces. Each face is a list of the face's corners (three or four), in the form vertex number/uv vertex number.

A vertex in the proxy mesh is associated with a weighted sum of three vertices in the original mesh. If the corners of the original face has coordinates v1, v2, v3 and the weights are w1, w2, w3 (w1 + w2 + w3 = 1), the proxy vertex has coordinates

pv = w1 v1 + w2 v2 + w3 v3

It inherits everything from its parent verts: morph targets, vertex weights, shapekeys, etc.

How to make a new proxy mesh:

1. Import the default mesh into Blender (a recent build of 2.5!) and rename it "Human"
2. Import your proxy mesh, or make one with the retopo tools. It must be called "Proxy".
3. Run the script utils/mhx/defineProxy.py. The variable path at the end of the script is your output file.
4. The script creates a proxy file without UVs.

To add UVs:

1. Export your proxy mesh as obj.
2. Delete the Faces section of the proxy file.
3. Copy the tex verts (lines that start with vt) and faces (lines that start with f) from the obj file into you proxy file.
4. Insert the line "TexVerts" before the first vt and "Faces" before the first f.
5. Delete all vt's and f's.
6. Compare with one of theĀ  to see how it should look.

How to improve vertex association

The algorithm works by associating a proxy vertex to its closest neighbor in the original mesh. Unfortunately, it becomes confused in areas where the original mesh has overlapping parts. The mouth area is especially nasty, but also the eyes and lips can cause problems. To assist the algorithm, you can assign vertex groups to both the proxy and the original mesh, e.g. to the upper/lower teeth, upper/lower gum, tounge and body. The program will then assign the closest vertex in the correct vertex group.