]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Exporting-a-weapon-for-Xonotic.md
More improvements, add modifiers guide before exporting
[xonotic/xonotic.wiki.git] / Exporting-a-weapon-for-Xonotic.md
1 ## WARNING: This tutorial is under construction!
2
3 Blender version recommended: 2.79b or later *(if you want to contribute, it's strongly important use 2.79b for compatibility cases, they need to open from this version).*
4
5 Requires these following tools (addons) for Blender:
6 - [IQM exporter](https://gitlab.com/xonotic/iqm) to export IQM files.
7 - [MD3 importer/exporter](https://github.com/neumond/blender-md3) to import/export MD3 files.
8
9 # Introduction to export a weapon
10 **Keep in mind about weapon systems:**
11
12 - `g_*.md3`: model mesh for item pickup spawn and third person.
13 - `h_*.iqm`: for first person animations; the skeleton and the bones (the rigging and animation part). Keep in mind, you would need `*.iqm.framegroups` (more info: [Framegroups](https://gitlab.com/xonotic/xonotic/-/wikis/framegroups), you can look `*.iqm.framegroups` opening a notepad to see what animations contain and the keyframes where these are set)
14 - `v_*.md3`: model mesh for first person and a glue of `h_*`; if `h_*.iqm` doesn't match with the animations needed of `v_*.md3`, it will generate spamming errors and bad pivot position.
15
16 More info: [Weapon modeling system](Weaponsystem)
17
18
19 # Textures and UV map
20
21 ### For MD3 exportation:
22
23 You have to add single material with single texture for every mesh object. Name of texture node will be written as is into MD3 data (suffixes like .001, .002 are ignored, feel free to use one texture for many meshes).
24 <br />
25 Keep in mind, when you've done your UV map in your model, you need to set this:
26 <br />
27 <br />
28 <img src="uploads/efee46a2a80a232ebe5fa63e30f4e2d9/Md3exp.png" alt="Md3exp" width="300" />
29 <br />
30 Texture must:
31
32 - be of **Image** type
33 - mapping type **UV**
34 - have UV map assigned
35
36 otherwise resulting data block will be filled with zeroes.
37 <br />
38 <br />
39 <img src="uploads/c48fb7565453eab24faca2d6ffec4347/Md3_textures.png" alt="Md3_textures" width="360" />
40 <br />
41 <br />
42 If you didn't this, the model will be invisible and it won't be able to interact shaders.
43 <br />
44 <br />
45 [Blender reference about UV in MD3](https://archive.blender.org/wiki/index.php/Extensions:2.6/Py/Scripts/Import-Export/MD3/)
46
47 # Starting to export
48
49 Keep in mind, you need to set these modifiers for each mesh/model object: 
50
51 <img src="uploads/447f6abe0f73c6d6cadce97e4ed66e8b/blendermodifiersiqmandmd3.jpg" alt="blendermodifiersiqmandmd3" />
52
53 ## MD3
54
55 Before to export, you need to select all objects in the scene. (Pressing A, seeing all objects borders are turning orange or red)
56
57 ## IQM
58
59 Before to export, you need to select all objects in the scene. (Pressing A, seeing all objects borders are turning orange or red)