Page 1 of 1
directy import .blend flles to ogre3d
Posted: Mon Sep 05, 2005 9:23 am
by ogx
hi everyone,
Im newbie here and i like to konw how can import .blend files directly to ogre3d.
I can find the dotScene xml and .mesh export script to ogre but it would
be a very good alternative if ogre see the .blend files like crystal space, cel, and crystalBlend project.
http://www.crystalspace3d.org/tikiwiki/ ... ystalBlend
Posted: Mon Sep 05, 2005 9:38 am
by fp12
Hi !
Sorry but actually Ogre uses its own optimized format (.mesh) that can be exported from Blender, XSI, Max, ...
All you have to do when you use Blender is just using the export script (python) to xml, then run a converter to .mesh and that's finished ! Then you can import it in your app with Ogre

Posted: Mon Sep 05, 2005 5:18 pm
by jmonw
Note: The exporter to .mesh does not come with Blender. It is available
in the CVS, though.
Best of luck.
Posted: Mon Feb 13, 2006 12:55 pm
by abhinavxrai
Just wondering - What is the file name in the CVS that has .xml to .mesh export / convertor??
Posted: Mon Feb 13, 2006 1:25 pm
by haffax
Here is the Ogre Blender-tools summary page in wiki:
http://www.ogre3d.org/wiki/index.php/Tools:_Blender
It has the download link for the dotscene exporter. The Ogre Mesh exporter is part of the Ogre tools:
http://www.ogre3d.org/index.php?option= ... tcat&cat=5
To import .material into Ogre
Posted: Tue Feb 14, 2006 9:50 am
by abhinavxrai
Ok so I got the OgreXMLConvertor that converts .mesh.xml to .mesh files. I have successfully imported the files into OGRE from blender and everything seems to work. Yipee!
However, the script in Blender that exports into xml files - also creates a Scene.material file that contains the data for textures, colors, etc. for all the objects.
I was wondering if someone had an idea of how to import and use this .material file in OGRE.
What if I import only a few objects and not all of them? Would the .material file import and work completely?
Thank you for your help!
Posted: Tue Feb 14, 2006 12:27 pm
by NeOmega
Posted: Tue Feb 14, 2006 8:12 pm
by jacmoe
The .material is Ogre: put it in your media path (media/materials/scripts) and your models will texture themselves.

Posted: Wed Feb 15, 2006 8:51 am
by abhinavxrai
Media path eh? I'm not quite sure what that exactly is.
I was checking the API for Ogre and I do see materials and Material and MaterialManager - is this how to import materials into Ogre? Or maybe I'm going in the wrong direction?
Since, I'm a newbie, could someone explain how this works?
EDIT:
Nevermind, did some exploring and I found what "jacmoe" was trying to say. Stupid me. I was searching for something else.
Thank a lot though jacmoe.
Posted: Wed Feb 15, 2006 9:14 am
by abhinavxrai
So I placed the .material file in the required folder, however, my objects still dont get their textures.
I am not loading all the objects contained in the original model, only a few.
So how does OGRE know what material to add to what object? I mean what .material file?
Is there any kind of setup that is required?
Posted: Wed Feb 15, 2006 9:27 am
by abhinavxrai
Ok I know this might be getting annoying, but please bear with me. I'm a poor newbie
So, I tried loading different models and this is what I found. No textures are being loaded, however, the models that have a base color, are being loaded perfectly fine.
Is it because the location of the texture image file is different? If yes, where do I place the images? If no, then im confused! Any ideas?
Posted: Wed Feb 15, 2006 12:58 pm
by haffax
abhinavxrai, look in your Ogre.log. It tells you what materials Ogre expects and didn't find or compile and the reason for it.
Materials are referenced in the mesh files. The meshes (or better submeshes) know which material they have to use.
One common error in this regard is to forget to initialise all resource groups. Did you call ResourceGroupManager::initialiseAllResourceGroups() *after* you added all pathes where to look for your resources, but *before* you create entities?
Posted: Wed Feb 15, 2006 12:59 pm
by P
The default material is defined at submesh level, you can see it when opening your .mesh.xml with and editor.
First thing would be to open ogre.log, if a material or an image isn't found, It will be written inside the log.
To render using a texture you need your mesh to have at least one set of uv coordinate.
edit : too slow
