Urho3D Wiki
Register
Advertisement

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.

Installation[]

  1. download the zip file from GitHub and unzip it;
  2. select the folder 'io_mesh_urho' and re-create a zip file (you need the folder 'io_mesh_urho' in the zip file);
  3. open Blender;
  4. open 'user preferences' (Ctrl+Alt+U);
  5. click 'Addons' on the top bar;
  6. click 'Install from file...' on the bottom bar;
  7. select your created zip file;
  8. now search in the list, you should see a greyed line named 'Import-Export: Urho3D export';
  9. 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);
  10. optional: click 'Save User Settings' to remember this addon as enabled.

Usage[]

Blender urho3d-0

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:

Blender model in urho3d-0

[WIKITODO: Test exporting with animation and maybe write about that if there are things to keep in mind.]

Advertisement