Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 14 (modified by landauf, 7 years ago) (diff)

fixed links

Object Export with Blender

Checked with Blender 2.48a on 12. Mar. 2009 by Felix

This page explains how to export 3D models from Blender to load them 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 Mesh Exporter, a python plugin for Blender. Get it from the Ogre webpage. For Blender 2.48a, you will need to have Python installed on your system, version 2.5.2 or higher. If you use Linux, you will most probably already have Python installed.

If a system wide installation is intended, unpack the zip archive you downloaded from the Ogre webpage into /usr/share/blender/scripts. If only a local installation in required or possible (probably due to the lack of permissions), unpack it somewhere in your home dir, ~/.blender/scripts/ is suggested.

Note: On the Tardis computers of D-ITET, the Blender Mesh Exporter is already installed.

Note 2: The manual for the OGRE Meshes Exporter can be found here.

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. Orxonox generates a database of all materials used and the primary key is the name of a material. So if two materials have the same name, the first one to be located is chosen (usually not the right one).
  3. It is very helpful, to name your objects and data blocks if you have not done so already (see picture).
  4. Open the export dialog (File → Export → OGRE Meshes). If this option doesn't show up, update the menus (Scripts Windows → Scripts → Update Menus). If it still doesn't show up, make sure you have installed the script correctly and you have python installed. Verify in the User Preferences Window under File Paths, that the path to Python scripts is correct.
  5. Select the model, check "OgreXML Converter", uncheck "Copy Textures", if your texture resides in the same folder as your blend file. Pick a sensible filename for your material under Material Settings.
  6. Hit Export.

This will create (at least) 4 new files in the blend-file-folder: a .mesh file, a .mesh.xml file, and a .material file. Most likely, a log file of the OgreXML Converter will be produced also. Ignore it for now.

The material filename will be the one you chose in the export dialog. This file contains all materials that are used in your scene, so if you export several meshes from the same scene (blend-file), you will only need one material file.

The name of the two mesh files will be the one you picked in the material window (see picture). The .mesh.xml file is a XML file containing the data of your object. Because you checked "OgreXML Converter", the XML file was directly converted to the binary mesh file, which we need to load the model into the game.

Attachments (1)

Download all attachments as: .zip