UPDATED to include some details about textures! Scroll down.
Ok, so I thought I should document my progress getting a new player-model into Xonotic (using an existing rig). It's not suitable as a tutorial for a total Blender N00b, but if you know your way around it should help you getting a model into Xonotic quickly.
I tried a while a ago already (http://forums.xonotic.org/showthread.php?tid=3065 ), but lost track and now realized that I had to figure it all out again newly This page on the wiki ( http://dev.xonotic.org/projects/xonotic/...der_to_IQM ) was helpful but lacked a few details.
Ok so this is how far I am already right now (I will reply to this post when I progress further):
1. Make a nice new player model in your favorite program (I used Wings3D and Blender3D)
2. Download a model source file for blender here. I was recommended to use either Erebus/MegaErebus (those 2 have identical rigs) or Ignis as those have the most up to date animations.
3. Open the file above in Blender and import your new mesh (as an .obj) into it for adjusting the size and proportions to the existing rig (don't forget to select the rig and put it into "rest pose" via the rig options). You can then delete the original mesh.
4. Shift select both the rig and your mesh and press "shift +P" and then select automatic weights to get a good first approximation of a weighted mesh. Switch back to "pose mode" and run some animations to check how the mesh deforms and if further adjustments are needed (you can also do proper hand weight painting now to fix the few issues, In general however fully hand weighting give the better results and gives better performance too; the less vertexes are bound to more than one bone the better for that).
5. Next you need to rename the material and the UV (maybe the mesh also?) inside blender to correspond to your texture file name. Usually all your files for one playermodel should start the same way e.g. the model should be "test.iqm" and the texture "test.tga" or such. Name the material and UV map then "test". I am still a bit confused about that part as the original models don't have a material and Nifrek said they shouldn't, but for me it only works with a material that has the right name. Edit: It also should not have a texture applied in the UVeditor window.
6. Now first select the mesh and then shift select the rig, so that the mesh has a dark orange outline and the rig is colored bright orange (it is important that you select the rig last!).
7. Now you can export your mesh via the previously installed iqm plugin (Latest confirmed working version of Blender: 2.67a, download here: http://lee.fov120.com/iqm/ ) by going to export -> inter-quake-model (.iqm). In the now opening dialog leave all the options as they are, just choose a file name (e.g. "test.iqm") and paste this:
Into the left-hand side box called "animations". Then press "export IQM" at the top.
8. It will take a few seconds and hopefully show no errors afterwards. The resulting "test.iqm" should be around a megabyte in size (if it is much less you did something wrong, could be much more depending on the complexity of your mesh though).
9. Copy the resulting test.iqm into your user directory (e.g. on Linux home/"user"/.xonotic in a subfolder structure mimicking the Xonotic .PK3 e.g. /data/models/player. The texture ("test.tga") belongs in /data/textures (I will cover compressed .dds textures later)
10. Also open the Xonotic data PK3 (it's a renamed .zip file) and navigate to the playermodels directory (e.g. ./data/models/player) and copy the additional files of the original rig you chose (f.e. Ignis) into the same directory as you put your test.iqm. These are the .iqm.framgroups , the .iqm_0.sounds and the .iqm_0.txt. Adjust the details in the txt file according to your liking and rename all to your model name e.g. test.iqm_0.txt and so on. Also copy or better make a preview image for the menu (e.g. the .iqm_0.jpg and .iqm_0_alpha.jpg). If you want you can also edit the .iqm.sounds file, but don't mess with the .iqm.framegroups file.
11. Fire up Xonotic, chose the new model and playtest. Binding "toggle chase_active" to a key in the menu can help you view the model from a 3rd person perspective. To view it nicely from all angles, record a demo and then start the demo after typing "camera_enable 1" into the console.
12. Adding a normal-map: This is a complex topic, but if you want it quick and dirty just run your diffuse texture through a normalmap filter plug-in in GIMP ( http://code.google.com/p/gimp-normalmap/ ) and it will give you a relatively flat and messy normal-map. Better is to make a higher-poly model and bake a normal map from it onto your game-model. Check out this Blender tutorial for details: http://joeyspijkers.com/t_normalmapping.html (Note: errors in a baked normal map can also be fixed by hand-painting each individual RGB in GIMP and running it through a normalizing filter afterwards. Blue is the hight, Red and Green two different light angles)
Once you have a normalmap, just place it called "test_norm.tga" in the usual texture folder. If it looks inverted you are not using the OpenGL normal-map style and have to invert the normal-map in the above GIMP filter (one click).
13. Adding team colors: To have red and blue colors in team games one needs to actually split the above created "test.tga" into a "test.tga" that has all the to be colored parts painted black and a "test_shirt.tga" that has everything but the to be colored parts painted black. Note that you don't actually have to color anything yourself, the engine will do it for you.
As such a split diffuse is a mess to work with if you still want to make some changes, I found it useful to create a selection channel in my .xcf gimp file that allows me to easily and very quickly recreated the split .tga files.
14. Next you can create a specularity map, called "test_gloss.tga". This will define the shininess of individual parts of the texture. Basically it is a greyscale image of your diffuse texture with the shinier parts increased in brightness and the duller ones darkened. Keep it overall relatively dark, or your model will shine like a plastic toy.
For advanced users it is also possible to have a full color gloss map, where the color defines the so called "specular exponent". This way you can even better emulate the material a surface is supposed to be made of. Plastics or car paints can stay a shade of gray, copper has an orange specular color, gold has a yellow specular color, steel has a very slight blue tint to its otherwise white specular color, aluminum also has a very slight tint.
15. Last but not least you can add a "test_glow.tga" texture that defines which part of the texture should glow like an LED (note: this is also used for full-bright textures I think, more to that later). This needs to be all black, with brighter areas only where it is supposed to glow. I have yet to test this fully, but it seems like if it is kept grey-scale it will also pick up the team-colors, but if you color it the result will glow in that specific color. (can anyone confirm this?)
Stay tuned
Ok, so I thought I should document my progress getting a new player-model into Xonotic (using an existing rig). It's not suitable as a tutorial for a total Blender N00b, but if you know your way around it should help you getting a model into Xonotic quickly.
I tried a while a ago already (http://forums.xonotic.org/showthread.php?tid=3065 ), but lost track and now realized that I had to figure it all out again newly This page on the wiki ( http://dev.xonotic.org/projects/xonotic/...der_to_IQM ) was helpful but lacked a few details.
Ok so this is how far I am already right now (I will reply to this post when I progress further):
1. Make a nice new player model in your favorite program (I used Wings3D and Blender3D)
2. Download a model source file for blender here. I was recommended to use either Erebus/MegaErebus (those 2 have identical rigs) or Ignis as those have the most up to date animations.
3. Open the file above in Blender and import your new mesh (as an .obj) into it for adjusting the size and proportions to the existing rig (don't forget to select the rig and put it into "rest pose" via the rig options). You can then delete the original mesh.
4. Shift select both the rig and your mesh and press "shift +P" and then select automatic weights to get a good first approximation of a weighted mesh. Switch back to "pose mode" and run some animations to check how the mesh deforms and if further adjustments are needed (you can also do proper hand weight painting now to fix the few issues, In general however fully hand weighting give the better results and gives better performance too; the less vertexes are bound to more than one bone the better for that).
5. Next you need to rename the material and the UV (maybe the mesh also?) inside blender to correspond to your texture file name. Usually all your files for one playermodel should start the same way e.g. the model should be "test.iqm" and the texture "test.tga" or such. Name the material and UV map then "test". I am still a bit confused about that part as the original models don't have a material and Nifrek said they shouldn't, but for me it only works with a material that has the right name. Edit: It also should not have a texture applied in the UVeditor window.
6. Now first select the mesh and then shift select the rig, so that the mesh has a dark orange outline and the rig is colored bright orange (it is important that you select the rig last!).
7. Now you can export your mesh via the previously installed iqm plugin (Latest confirmed working version of Blender: 2.67a, download here: http://lee.fov120.com/iqm/ ) by going to export -> inter-quake-model (.iqm). In the now opening dialog leave all the options as they are, just choose a file name (e.g. "test.iqm") and paste this:
Code:
dieone,dietwo,draw,duck,duckwalk,duckjump,duckidle,idle,jump,fly,painone,paintwo,shoot,taunt,run,runbackwards,strafeleft,straferight,deadone,deadtwo,forwardright,forwardleft,backright,backleft,melee,duckwalkbackwards,duckstrafeleft,duckstraferight,duckforwardright,duckwalkforwardleft,duckbackwardright,duckbackwardleft
Into the left-hand side box called "animations". Then press "export IQM" at the top.
8. It will take a few seconds and hopefully show no errors afterwards. The resulting "test.iqm" should be around a megabyte in size (if it is much less you did something wrong, could be much more depending on the complexity of your mesh though).
9. Copy the resulting test.iqm into your user directory (e.g. on Linux home/"user"/.xonotic in a subfolder structure mimicking the Xonotic .PK3 e.g. /data/models/player. The texture ("test.tga") belongs in /data/textures (I will cover compressed .dds textures later)
10. Also open the Xonotic data PK3 (it's a renamed .zip file) and navigate to the playermodels directory (e.g. ./data/models/player) and copy the additional files of the original rig you chose (f.e. Ignis) into the same directory as you put your test.iqm. These are the .iqm.framgroups , the .iqm_0.sounds and the .iqm_0.txt. Adjust the details in the txt file according to your liking and rename all to your model name e.g. test.iqm_0.txt and so on. Also copy or better make a preview image for the menu (e.g. the .iqm_0.jpg and .iqm_0_alpha.jpg). If you want you can also edit the .iqm.sounds file, but don't mess with the .iqm.framegroups file.
11. Fire up Xonotic, chose the new model and playtest. Binding "toggle chase_active" to a key in the menu can help you view the model from a 3rd person perspective. To view it nicely from all angles, record a demo and then start the demo after typing "camera_enable 1" into the console.
12. Adding a normal-map: This is a complex topic, but if you want it quick and dirty just run your diffuse texture through a normalmap filter plug-in in GIMP ( http://code.google.com/p/gimp-normalmap/ ) and it will give you a relatively flat and messy normal-map. Better is to make a higher-poly model and bake a normal map from it onto your game-model. Check out this Blender tutorial for details: http://joeyspijkers.com/t_normalmapping.html (Note: errors in a baked normal map can also be fixed by hand-painting each individual RGB in GIMP and running it through a normalizing filter afterwards. Blue is the hight, Red and Green two different light angles)
Once you have a normalmap, just place it called "test_norm.tga" in the usual texture folder. If it looks inverted you are not using the OpenGL normal-map style and have to invert the normal-map in the above GIMP filter (one click).
13. Adding team colors: To have red and blue colors in team games one needs to actually split the above created "test.tga" into a "test.tga" that has all the to be colored parts painted black and a "test_shirt.tga" that has everything but the to be colored parts painted black. Note that you don't actually have to color anything yourself, the engine will do it for you.
As such a split diffuse is a mess to work with if you still want to make some changes, I found it useful to create a selection channel in my .xcf gimp file that allows me to easily and very quickly recreated the split .tga files.
14. Next you can create a specularity map, called "test_gloss.tga". This will define the shininess of individual parts of the texture. Basically it is a greyscale image of your diffuse texture with the shinier parts increased in brightness and the duller ones darkened. Keep it overall relatively dark, or your model will shine like a plastic toy.
For advanced users it is also possible to have a full color gloss map, where the color defines the so called "specular exponent". This way you can even better emulate the material a surface is supposed to be made of. Plastics or car paints can stay a shade of gray, copper has an orange specular color, gold has a yellow specular color, steel has a very slight blue tint to its otherwise white specular color, aluminum also has a very slight tint.
15. Last but not least you can add a "test_glow.tga" texture that defines which part of the texture should glow like an LED (note: this is also used for full-bright textures I think, more to that later). This needs to be all black, with brighter areas only where it is supposed to glow. I have yet to test this fully, but it seems like if it is kept grey-scale it will also pick up the team-colors, but if you color it the result will glow in that specific color. (can anyone confirm this?)
Stay tuned