A tutorial on copying vertex assignments to a custom head model and setting up a model for use in Rugby 08, sorry it's quite wordy:
2. Import a default head with skeleton to Blender, or use the template file I have provided here. My template also includes a body model to help with positioning and scaling of the head.
3. Copy your custom head to the same Blender project. Scale the custom head to line up the position of the eyes, mouth, nose etc. of the default one.
4. In Object mode, in the preview window click on your custom head, then shift-click the skeleton. Right click in the window to bring up the context menu, then select "
Parent - with empty groups". Once done click on any blank space in the preview window to apply the parent. This assigns the custom head with the vertex groups of the skeleton, in the vertex group menu should be 50 Groups including Hips, Lowerspine, Rtoe etc.
5. The next steps copy the vertex group assignments from the template model onto your custom model. Vertex assignments are needed to tell the game what each bit of the head does. These can be done manually instead, but it is time consuming.
The head
NEEDS to have
UpperSpine, Neck and Head groups assigned, and
ALL vertices must be assigned to at least one of these 3 groups, otherwise it will not appear in-game correctly. Vertices can be in more than one group, for example all vertices in the UpLip group will also be assigned to the Head group.
6. In object mode, in the preview window click on the template/default head, then shift-click onto your custom head. Change from "Object mode" to "
Weight paint mode". If done correctly your custom head will appear dark blue in colour.
7. In weight paint mode click on the weights context button, then "
Transfer Weights". In the sub-menu that appears at the bottom of the tab change "Source Layers Selection" to "
By Name". Once done click on any blank space in the preview window to apply the transfer.
8. The auto-transfer needs to be cleaned to work in the game. click the weights context button again, then "
Clean". In the sub-menu at the bottom of the page change "Subset" to "
All Groups" and increase the threshold to around 0.1. Once done click on any blank space in the preview window to apply the cleaning.
9. If the above has worked you can test the assignments in Edit mode by selecting a group and click the "Select" button in the group menu, which will highlight the current assignment for that group. You can use the Assign and Remove buttons here to correct any of the groups. Once assignments are done you can delete any template models etc. you should be left with only your custom head and the skeleton.
10. In the vertex colors section, remove any existing vertex color indexes by clicking the minus button. Once the menu is empty click the plus button to add
1 color index. If there is no vertex color index the head will appear very dark in the game.
11. Change the name of the material on your head to
mat1 [LitTexture2IrradSkinSubSurfSpec,tex1:dirt] . Any additional materials can be named mat2, mat3 etc. with the same parentheses following. For example mat2 can be for a scrumcap or hair model.
12. Change the base color mode of your material to "Image texture" and make sure your image texture name contains no more than 4 characters. The normal names to use are "face.png" and "hair.png". These names MUST match the texture names as listed in your Textures.fsh file.
13. In Object mode, click on your model, press ctrl A and in the context menu click apply "All Transforms". The model can now be exported to a .gltf file, make sure the export format is "gltf separate".
14. Using OTools, use "Import to .O" mode to create your .o file, it must be called "model.o". For additional command-line options use
-skeletondata none. If any of your textures need transparency also add
-sortbyalpha. Add your textures to your Textures.fsh file. Pack both of these into your .big file. Test the head in game.
15. The file name for player heads is
players/heads/xxx where xxx is the head ID number, passed through the MD5 hash. For example
players/heads/9 is
2f91449615878d606939bc5e10fbb528 without .big on the end.
https://www.miraclesalad.com/webtools/md5.php can generate these names.