Blender site: http://www.blender.org/
This guide was tested with with Blender 2.73a on Windows 7 (direct link: http://download.blender.org/release/Blender2.73/blender-2.73a-windows64.exe) and Urho3D 1.32.
The Blender to Urho3D exporter and the official guide can be found here: https://github.com/reattiva/Urho3D-Blender
This guide tries to be a simplified and stripped down version of the official guide to get started faster.
- download the zip file from GitHub and unzip it;
- select the folder 'io_mesh_urho' and re-create a zip file (you need the folder 'io_mesh_urho' in the zip file);
- open Blender;
- open 'user preferences' (Ctrl+Alt+U);
- click 'Addons' on the top bar;
- click 'Install from file...' on the bottom bar;
- select your created zip file;
- now search in the list, you should see a greyed line named 'Import-Export: Urho3D export';
- click on the checkbox on the right to enable the addon (see https://github.com/reattiva/Urho3D-Blender/blob/master/guide.txt if you can't set the check);
- optional: click 'Save User Settings' to remember this addon as enabled.
The exporter can be found in the render tab below the freestyle area.
The "Export" button does the export and below are the preferences for the export.
The settings have tooltips and are mostly easy to understand. For a more detailed and complete list see the official guide linked above.
- Object: If all or only the selected models should be exported
- Origin: If the coordinates of each model should the relative to the world (Global) or to the object itself (Local).
- Geometries: What kind of vertex data should be exported.
The Blender exporter created three files:
- [Materialname].xml: this contains a definitons of the used material and names the textures with their path.
- [Objectname].mdl: The model itself.
- [Textureimage]: The images used as a textures, if you checked "Copy textures" in the exporter. These may be multiple images.
Urho3D has materials, models and other data in the "Data" folder, which has several subfolders. The created files need to be copied where Urho3D can reach them and the paths, inside the Material.xml, may need to be adjusted.
A Material.xml may look like this:
<material> <technique name="Techniques/DiffNormal.xml"/> <texture name="Textures/testmesh.png" unit="diffuse"/> <texture name="Textures/testmesh2.png" unit="normal"/> <parameter name="MatDiffColor" value="0.64 0.64 0.64 1"/> <parameter name="MatSpecColor" value="0.5 0.5 0.5 50"/> </material>
This Blender model had two textures: one for the color and one for the normal map for "bumpiness" (which you can see in the Blender screenshot). So the exporter put both in the Material.xml and set them as as diffuse (color) and normal map. The name in the unit field is just a variable name and could in principal be used for anything by the shader.
The technique "Techniques/DiffNormal.xml" entered by the exporter is how the material should be displayed. This could be a more complicated and custom shader.
When loaded into Urho3D the model looks like this:
[WIKITODO: Test exporting with animation and maybe write about that if there are things to keep in mind.]