Introduction

Blender is an open source 3D modeling program. It is one of the most popular programs used for modeling, texturing, animating and rendering. It is available for free, for all major operating systems.
You can create any kind of 3D model in Blender, then export it to be used in your Ogre3D application.
This page covers what Blender can do for an Ogre developer, the tools available and common problems experienced.

Table of contents

Tools

The basic tools are importing information into Blender, exporting it out, any necessary conversions and requirements for rendering in Ogre. The list below is a quick summary of the tools available. Further down the page are more in-depth descriptions of some of the major tools.

Note that all of these tools are created by the community, you and I, just like this wiki. If a tool doesn't have a feature you'd like (or has a bug you'd like to get rid of), perhaps you can persuade the author to work on it, or you are welcome to submit patches. Search in the forum for news and discussions on a particular tool. Features, bugs and project status are often discussed there.

Blender is not a trivial application one can just play with, and hope to guess how it works.
Start at the beginning: follow one or two introductory tutorials from the above-listed websites, and you'll see how the pieces fit together.

What do you mean 'Found in ogreaddons', 'Tools/*' or SVN

SVN (Subversion) is a tool we use to store the source code for ogre. ogreaddons is in a separate directory from the Ogre Rendering Engine SVN repository. For the most up to date copy, browse our SVN Repository and download the latest versions or read the Ogre Community Add-on Projects to learn more about Ogre Add-ons and how to download. Read Getting OGRE From Subversion for more information about Ogre and SVN.

(Note: Ogre and Ogre add-ons used to be held in a CVS-repository, so you may run across references to "CVS" in the wiki pages. You can change "CVS" for "SVN" in those pages and you are fine. They are very similar systems. The link to the repository and tools for reading them are of course changed. See the above links for info.)

What is an Octree?

An octary tree - a tree with 8 children per node. Each node represents a cube. Cut that cube with 3 even slices, 1 down the middle of each face (X plane, Y plane and Z plane). Now your single cube has turned in to how many cubes? The answer is left as an exercise for the reader.

Octree is a space-partitioning technique, an alternative to BSP. Deciding whether to use Octree or BSP depends on several factors, but in general Octrees are better for levels with a lot of open space, or levels that are very dynamic, while BSPs are better for levels with dense, crowded geometry, or levels that are quite static. Octrees usually cost more computationally than BSPs, but that's because BSPs require preprocessing ('baking') and are therefore inherently more static, so that's a tradeoff you'll have to decide on. For comparison, idTech and Unreal Engine use BSPs, while CryEngine uses Octrees.

What is UV Texturing?

Texture mapping. It means applying a 2D image onto a 3D object. You'll need to define UV coordinates in Blender on your object before you can apply a UV texture or expect Ogre to display it properly.

Why do I get some strange python or other errors when running a script?

Blender uses the Python programming language to execute scripts. Some scripts need a full Python environment to be executed. Python is not installed by default on some operating systems, such as Windows.
So be able to execute the script, you'll have to install the correct version of Python on your machine:

check which version of Python is expected in the console, when Blender starts

go to the list of Pyton releases, and download the appropriate version. Only the first two version numbers matter. For example if Blender asks for Python 2.6, then installing Python 2.6.6 is ok, but not Python 2.7 or 2.5.

Mesh and Armature Exporter

When I select multiple objects in blender and use the export with OgreXML, why do I get so many xml files?

OgreXML is the BlenderExport tool, which is only for exporting a single mesh. Export your objects individually or use the dotScene exporter. You can also join your objects into a single mesh within Blender with Object->Join Objects or Ctrl+J.

My objects look smooth and nice in Blender, but when I view them in Ogre they look all blocky. Why?

You are probably using subdivision surfaces in Blender (subsurf). Blender does not export these surfaces so you get the original mesh you started with. Use the Object->Convert Object Type or Alt+c functions to convert the subsurfed mesh into a real mesh. This will duplicate your object in the same spot. Make sure to select and export only the new mesh for Ogre.

I added a texture to the material definition file after export, why doesn't it display?

If you do not define any uv coordinates for your mesh, Ogre sets them to the default value (0,0). In this case you see the first texture pixel as colour. See Blender's documentation on how to use uv-textures.

Why does the export log say "error in normalize"?

This error happens if the length of the vector to normalize is below some threshold. This may happen in the calculation of face normals (likely) or in the conversion of the armature (not likely). In the case of the face normal you have some really small faces in your mesh, which is usually not what you want. In this case you can use the "Remove Doubles" option in Blender's "Mesh Tools" to get rid of them.

Why does the script abort with an IndexError?

If you are trying to export an object that doesn't have a material, you may get this error:

My model looks squeezed in Ogre. Can I export a mesh object in object coordinates but with object size transformation applied?

No, but you can apply the object transformations with "Object->Clear/Apply->Apply Size/Rotation" (Ctrl+A).
Alternatively, you can apply the mesh object size transformation with the applymeshobjectsize.py script before exporting.

Why does my animation look distorted and weird in Ogre, while it looks good in Blender?

There are several things you can check that can cause a distorted animation:

Select your skeleton/armature, go to edit mode and press N, the property window opens, set the "Roll"-value for each bone to zero, unless you intentionally want it different.

Go back to Object mode, select your mesh and press N to get the properties window, make sure all "size"-values are positive numbers.

Like in the answer to the previous question mentioned apply the object transformations with "Object->Clear/Apply->Apply Size/Rotation" (Ctrl+A), after parenting the object

to the armature, before you animate, or use this applymeshobjectsize.py-script for existing animations before you export.

Why are some of the faces not visible in Ogre although I can see them in Blender?

Usually faces have only one visible side determined by the face normal. You can check visibility in Blender using Blender's internal game engine (P, Esc). Normals can be displayed in "Edit Mode" using the "Draw Normals" option from the "Editing" buttons. You can change normals using the "Mesh->Normals" menu. If you want the face to be visible from both sides in Ogre also, e.g. for foliage, select the face in "UV Face Select" mode and set it to "Two Sided" via the "Face->Active Draw Mode" menu.

What's the purpose of "Game Engine Materials" option?

If you export with "Game Engine Materials" enabled, the exported mesh should look similiar to the mesh in Blender's game engine (Draw type: Textured, P key). If "Game Engine Materials" is disabled on export, the result should look similar to Blender's rendering result (F12 key).

My mesh has a strange rotation or translation in Ogre relative to how it appears in Blender.

The mesh exporter computes the mesh relative its own local coordinate system, not the global coordinate system. One way to fix is this is to reset the local coordinate system in Blender to match the global system (using Transform->Properties), then transform the mesh to the way it should be in Edit Mode, which will not alter the local coordinate system.

dotScene Exporter

How do I define an object or mesh as static for Ogre?

First you need CVS revision 1.2 or higher of the export script. Then select the mesh. In logic buttons (F4), add a property of type "Bool", named "static" and set it to true.

Non Advanced Search or Natural Search

The documents are returned sorted on relevance depending on order, proximity, frequency of terms.

Advanced Search or Boolean Search

Default search behavior

By default, all search terms are optional. It behaves like an OR logic. Objects that contain the more terms are rated higher in the results and will appear first in their type. For example, wiki forum will find:

objects that include both terms

objects that include the term wiki

objects that include the term forum

Requiring terms

Add a plus sign ( + ) before a term to indicate that the term must appear in results. Example: +wiki forum will find objects containing at least wiki. Objects with both terms and many occurences of the terms will appear first.

Excluding terms

Add a minus sign ( - ) before a term to indicate that the term must not appear in the results. To reduce a term's value without completely excluding it, use a tilde. Example: -wiki forum will find objects that do not contain wiki but contain forum

Grouping terms

Use parenthesis ( ) to group terms into subexpressions. Example: +wiki +(forum blog) will find objects that contain wiki and forum or that contain wiki and blog in any order.

Finding phrases

Use double quotes ( " " ) around a phrase to find terms in the exact order, exactly as typed. Example: "Alex Bell" will not find Bell Alex or Alex G. Bell.

Using wildcards

Add an asterisk ( * ) after a term to find objects that include the root word. For example, run* will find:

objects that include the term run

objects that include the term runner

objects that include the term running

Reducing a term's value

Add a tilde ( ~ ) before a term to reduce its value indicate to the ranking of the results. Objects that contain the term will appear lower than other objects (unlike the minus sign which will completely exclude a term). Example: +wiki ~forum will rate an object with only wiki higher that an object with wiki and forum.

Changing relevance value

Add a less than ( < ) or greater than ( > ) sign before a term to change the term's contribution to the overall relevance value assigned to a object. Example: +wiki +(>forum < blog) will find objects that contain wiki and forum or wiki and blog in any order. wiki forum will be rated higher.