Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 8 (modified by zifloria, 8 years ago) (diff)

Exporting Objects From Blender To Orxonox

Checked with Blender 2.69 on 27 Feb. 2017

This page explains how to export 3D models from Blender and view them in a Level in Orxonox.

mesh Files

Ogre understands only the Ogre-specific .mesh files, so we have to export our objects from Blender to a .mesh file. A .mesh file is a binary file, that contains one single mesh (object).

Prerequisites

To export to mesh we first need the 'Blender Exporter' and the 'Ogre Command-line Tools'.

The Blender exporter works well with Blender 2.69, other versions haven't been tested.

The Ogre command-line tools are available here (Windows and Mac).
On linux, its called 'ogre tools'. We need the 'ogre-1.8-tools' version.
For the ETH tardis PCs I uploaded the binary here

Blender Exporter

Download the addon here (blender2ogre-0.6.0.zip).

In Blender, open 'User Preferences' → 'Install from file …'.
Then choose the .zip file and activate the addon.

Command-line Tools

Download and extract to any location you want, just remember where.

Exporting to mesh

  1. Check if all textures for your objects are loaded into Blender.
  2. Make sure your materials don't still have the generic name ('Material', 'Material.001', …), otherwise Orxonox might not choose the correct material for your model.
  3. Name your objects and meshes
  4. Open the export dialog (File → Export → Ogre 3D). If it doesn't show up, make sure you have installed the script correctly.
  5. Select the model and hit Export. This will produce a '.mesh.xml' file

Then you need to manually convert them with the XML converter.

On Windows, drag the file on the XML converter executable.
On Linux, open a terminal and execute ./OgreXMLConverter fileName.mesh.xml

This will create (at least) 2 new files: A .mesh file and a .material file. Most likely, a log file of the OgreXML Converter will be produced too.

To Orxonox

  1. Copy the .mesh file to …/data_extern/models
  2. Copy the .material file to …/data_extern/materials
  3. Copy any texture files to …/data_extern/images/textures
  4. Goto trunk/data/levels and open any level file (empty_level.oxw is always a good choice for tests) and insert:
    <?lua ... >
    <Level ...>
    <Scene ...>
    ...
    <Model mesh="yourModel.mesh" position="0,0,0" />
    ...
    </Scene>
    </Level>
    
  5. Make sure you have respected the Guidelines?