|
| 1 | +--- |
| 2 | +title: Editing: Models |
| 3 | +layout: docs |
| 4 | +origfile: editing/Models.md |
| 5 | +origtitle: Models |
| 6 | +permalink: /docs/editing/Models |
| 7 | +redirect_from: |
| 8 | + - /wiki/editing/Models/ |
| 9 | +--- |
| 10 | +* TOC |
| 11 | +{:toc} |
| 12 | +# Models |
| 13 | +## Importing Models |
| 14 | +### Supported Formats |
| 15 | +Redeclipse supports several model formats; |
| 16 | +* OBJ (object wavefront) |
| 17 | +* IQM (inter-quake model format) |
| 18 | + |
| 19 | +Models that require a bone for positioning, or contain animations will need to be exported as IQM. We reccomend using Blender for 3D modelling, due to the IQM exporter. |
| 20 | + |
| 21 | +An IQM exporter can be obtained here: https://github.com/lsalzman/iqm |
| 22 | +Pick the lastest version of the plugin if using blender 3.0+. |
| 23 | + |
| 24 | +### Configuration |
| 25 | +Exported models are loaded using a config file. If using the obj format, you will need an obj.cfg file. When using IQM, you will need an iqm.cfg file. |
| 26 | + |
| 27 | +An example obj.cfg: |
| 28 | +``` |
| 29 | +// obj.cfg |
| 30 | +objload path/to/mesh.obj |
| 31 | +objskin * path/to/diffuse.png |
| 32 | +objbumpmap * path/to/normal.png |
| 33 | +mdlscale 1000 |
| 34 | +``` |
| 35 | +and similarly iqm.cfg: |
| 36 | +``` |
| 37 | +// iqm.cfg |
| 38 | +iqmload path/to/mesh.iqm |
| 39 | +iqmskin * path/to/diffuse.png |
| 40 | +iqmbumpmap * path/to/normal.png |
| 41 | +mdlscale 250 |
| 42 | +``` |
| 43 | + |
| 44 | +### Examples |
| 45 | +#### obj |
| 46 | +This example uses a mesh exported for use as an obj model. |
| 47 | + |
| 48 | +Within blender: |
| 49 | +* Add a new mesh to the scene |
| 50 | +* Export as obj |
| 51 | + |
| 52 | +save your mesh.obj file to the same folder as your obj.cfg |
| 53 | + |
| 54 | +#### iqm |
| 55 | +This example uses a mesh exported for use as an iqm model. |
| 56 | + |
| 57 | +An IQM model requires at least one bone present. |
| 58 | + |
| 59 | +Within blender: |
| 60 | +* Add a new mesh to the scene |
| 61 | +* Create an armature |
| 62 | +* Select the mesh, then the armature together |
| 63 | +* Pair with Ctrl + P, and select automatic weights |
| 64 | + |
| 65 | +You can now export your model to iqm, make sure the mesh and the armature is selected. For now you can use the default settings within the exporter, save your mesh.iqm file to the same folder as your iqm.cfg |
| 66 | + |
| 67 | +## Loading models |
| 68 | +Models can be loaded into the game in various ways. |
| 69 | + |
| 70 | +### Mapmodels |
| 71 | +Mapmodels can be loaded into a map during an editing session by running `mmodel path/to/model`. You can then find it at the last index on the mapmodel entity. When saving the map, `mmodel path/to/model` will be automatically ammended to the maps own cfg file. You can also manually edit the map config to register mapmodels for use in a map. |
| 72 | + |
| 73 | +### Player Vanities |
| 74 | +Vanities are defined in `vanities/package.cfg`, and need to be exported as IQM as per requiring a bone for positioning. |
0 commit comments