directy import .blend flles to ogre3d

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
ogx
Gnoblar
Posts: 7
Joined: Mon Sep 05, 2005 9:02 am

directy import .blend flles to ogre3d

Post 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
fp12
Halfling
Posts: 99
Joined: Sat Jul 09, 2005 12:11 am
Location: Nantes - France
Contact:

Post 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 ;)
User avatar
jmonw
Goblin
Posts: 232
Joined: Sat Apr 23, 2005 3:21 am
Location: Atlanta, GA

Post by jmonw »

Note: The exporter to .mesh does not come with Blender. It is available in the CVS, though.

Best of luck.
User avatar
abhinavxrai
Halfling
Posts: 54
Joined: Wed Jan 25, 2006 7:47 am
Location: Victoria, Canada / Israel / New Delhi, India

Post by abhinavxrai »

Just wondering - What is the file name in the CVS that has .xml to .mesh export / convertor??
"Every new begining comes from some other begining's end."

Signatures with small Font are AWESOME
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post 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
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
abhinavxrai
Halfling
Posts: 54
Joined: Wed Jan 25, 2006 7:47 am
Location: Victoria, Canada / Israel / New Delhi, India

To import .material into Ogre

Post 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!
"Every new begining comes from some other begining's end."

Signatures with small Font are AWESOME
User avatar
NeOmega
Halfling
Posts: 86
Joined: Mon Apr 04, 2005 2:30 am
Location: Washington State, USA

Post by NeOmega »

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

The .material is Ogre: put it in your media path (media/materials/scripts) and your models will texture themselves. :wink:
User avatar
abhinavxrai
Halfling
Posts: 54
Joined: Wed Jan 25, 2006 7:47 am
Location: Victoria, Canada / Israel / New Delhi, India

Post 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. :oops:

Thank a lot though jacmoe.
Last edited by abhinavxrai on Wed Feb 15, 2006 9:20 am, edited 1 time in total.
"Every new begining comes from some other begining's end."

Signatures with small Font are AWESOME
User avatar
abhinavxrai
Halfling
Posts: 54
Joined: Wed Jan 25, 2006 7:47 am
Location: Victoria, Canada / Israel / New Delhi, India

Post 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?
"Every new begining comes from some other begining's end."

Signatures with small Font are AWESOME
User avatar
abhinavxrai
Halfling
Posts: 54
Joined: Wed Jan 25, 2006 7:47 am
Location: Victoria, Canada / Israel / New Delhi, India

Post by abhinavxrai »

Ok I know this might be getting annoying, but please bear with me. I'm a poor newbie :lol:

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?
"Every new begining comes from some other begining's end."

Signatures with small Font are AWESOME
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post 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?
team-pantheon programmer
creators of Rastullahs Lockenpracht
P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post 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 :)
Post Reply