OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: Complete Guide: Exporting Blender To Ogre
View page
Source of version: 9
(current)
!Prerequisites This tutorial assumes that you can handle ((Tools: Blender|Blender)) with basic modelling and animeting (also with skeletons). This tutorial is really more about exporting successfully animations, ((-Mesh|meshes)) and ((-Material|materials)) to Ogre. !Tools First things first. So, before you can export anything from Blender you need proper exporters for them. Current exporters works only with Blender 2.49b. I'm using two exporters with Blender: __1. Meshes and materials__ This exporter basicly turns meshes to XML and then optionally run through ((OgreXMLConverter)), which converts XML to ogre's binary .mesh-format. You find the exporter on page ((Blender Exporter)). __2. Scene__ Usually exporting meshes just isn't enough. Scene describes where objects are locating. More importantly it describes also cameras and lights, so there is no need to worry about them in code. I decided to use ((DotScene)), because it's very simple XML-format and well supported by community. Blender's DotScene exporter can be downloaded here. !Let's rock! First of all, you need something to export. This tutorial uses simple robot mesh, which you can download [http://zcmander.kapsi.fi/muuta/robot.blend|here] (Feel free to mirror it). To say a word about animating object for Ogre: I create all actions to start from frame 1 and end where ever it ends. Then I can choose 'current' action by enabling that action in ''NLA Editor''. {img fileId="1932" thumb="n" alt="" rel="box[g]"} Also you need to check that armature and animated object are without translations, scaling or rotating (You can check that by pressing N and then select armature and after that object). If they have something wierd rotations and scalings as I had then blender shows animation just fine, but after exporting it acts very wierdly. If you have object translations or other, you can apply them to object by pressing __Ctrl A, 1__. {img fileId="1934" thumb="n" alt="" rel="box[g]"} Above image demonstrates problem with different object properties in armature and model. !!Export Everything If you have many meshes in scene, You need to export them all at once, because otherwise you can loose some materials and existing meshes can't find their material. {img fileId="1935" thumb="n" alt="" rel="box[g]"} Open Export dialog __File->Export->OGRE Meshes__ and then select PlayerMesh if not selected, then select Skeleton and press Add for adding animation. Then choose predefined Action ''Run''. Also you could rename the filename ''Scene.material'' in the exporter GUI. The materials will be saved there. Using a scene specific name is good, because it avoids problems, when you have different scenes and each has the filename ''Scene.material''. (So by export the materials of other scenes could be overwritten.) After that you need information about lenght of animation. You can see it with ''NLA Editor'' and buttons window, by moving current frame to end of action in ''NLA Editor'', and check accured frame number in buttons window. Because action beging at frame 1, there is no need to modify Start-value. After that there is name for animation in Ogre. You can leave it to 'Run'. Other buttons are self-explanatory. But you want to check ''OgreXMLConverter'' and set path for that in Preferences. After that you can just hit Export and wait for rolling all meshes and animations. !!Export Scene {img fileId="1933" thumb="n" alt="" rel="box[g]"} Exporting scene is even easier. Just select all and hit Export button. Just make sure that you have correct Path. You can leave Filename-field empty and it will get that from scene name. !Using scene in Ogre Now you have successfully created .mesh and dotScene-formated .xml file. Now you just need to import them to Ogre. Meshes works right away, just use them as you would normally do, but dotScene requires specific reader. I use for dotScene parser a ((New DotScene Loader)). I did some changes, because it ((New DotScene Loader)) wasn't reading my scene file correctly: __Todo:__ Add the whole modified file as attachement to this wiki page (see buttons on page bottom). This is more easy to use. __Removed diff for dotSceneLoader__
Search by Tags
Search Wiki by Freetags
Latest Changes
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
MOGRE Editable Terrain Manager
...more
Search
Find
Advanced
Search Help
Online Users
17 online users