Converting to xml.mesh from Blender

Guys I am trying to convert my object from .blend to Ogre3d/OgreXML. So I save as Ogre3d and my object loses its shape (becomes a cuboid) and retains one of the materials it had. So my car shape model that had two materials becomes a bigger cuboid with one material when I export as Ogre3D. Any idea why? is there a different approach to export?

blender version?

ogre exporter source(from where you get it)?



materials need to be the same name as mesh.xml file(while converting), but btw i propose you to use j3m.



why cuboid? i have no idea, i had never this problem. so i think it is version problem or somethin else.

could you do some testcase with that object?



or maybe you mean sharp shape edges? you need to make it smooth in blender.

thanks for the response.



sure I can use J3m… Can I use LOD with j3m?



my object is a cuboid that I modified so what’s happending it’s not displaying the right dimensions. I am using the Blender 2.61. I got the scripts from one of the posts on the forum if I’m not mistaken.

@nightwolf911 said:
thanks for the response.

sure I can use J3m... Can I use LOD with j3m?

my object is a cuboid that I modified so what's happending it's not displaying the right dimensions. I am using the Blender 2.61. I got the scripts from one of the posts on the forum if I'm not mistaken.



in blender:
- select object in object mode
- ctrl - a -> apply rotation and scale.

then try export :)


edit:
about a LOD, why not? LOD is not depends on it as i know.
and about exporter you have it in SDK: tools -> ogre XML -> install
SDK -> Ogre XML -> install


ok so I did that successfully - not sure how to use it, so I import the .blend object inside my project and it's converted automatically into .j3o

and then what? I don't mind staying with j3o but how do I create the .j3m?

thanks

SDK → Ogre XML → install should just install ogre exporter for blender. blend → j3o no need to install it



there was always 2 ways:

  • export to ogre → export to j3o
  • just export blend → j3o



    j3m is a material file based on j3md (material definition file - this one based on shaders).



    in j3m you choose j3md to be based on.

    there are many material definitions, and you can always create you own. common j3md are:

    lighting.j3md (color texture is diffuse texture here)

    unshaded.j3md



    all you can do in SDK.



    just create a new materialname.j3m in assets/material (or where you need), and then editing j3o in SceneComposer, select geometry and on right side you will have a select to choose your material.



    you can also apply material “ingame”, but better to use SceneComposer.



    old tutorial(but still you do it same way):

    http://www.youtube.com/watch?v=Feu3-mrpolc

Then fine cz all my objects are .blend. So I moved an object .blend in the SDK – OK and then to create the j3m I have the option of one material. But my object needs to have two separate materials. To be clear I have a car with a ceiling where the ceiling is white and the car is red.





PS: Thats why I was using .obj cz I have my meshes in .obj and the material in .mtl - looked more simple at the time.

if you want 2 materials you need 2 geometries in SceneComposer.



or you need to create TextureAtlas (i mean one texture containing all textures you need) and then apply it in blender by UV map(but then it is like one material with many diffuse/color textures). That is how i do it :slight_smile:



somethin like:

http://www.larabie.net/ogre/CombinedTextures.jpg



this is how all games are created. you need one textureAtlas.



btw, there was an topic with it too:

http://hub.jmonkeyengine.org/groups/graphics/forum/topic/import-from-blender-messes-up-materials

1 Like

thats great!!! thank you so much…

How do you control the LOD level from the SDK though? I am doing it from Blender itself.

btw can I not just use my j3o object (as I have the material already created for it in Blender) and add

[java]Material mat = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);

[/java]

with it?



and yes actually i couldn’t figure out yet how to set LODs for j3o objects, all examples have it in ogrexml where I think u’d do that from Blender

example from wiki:

[java]cube.setMaterial((Material) assetManager.loadMaterial( “Materials/LeakThrough.j3m”));[/java]



remember j3m is your material. j3md is a definition(something like DTD in xml) to create materials based on it.



j3md contains informations about materials parameters(uniforms for shaders) and what shaders use to render object.

Common/MatDefs/Light/Lighting.j3md is one of main(ready to use) material definitions.





but:



why you apply material “ingame”? dont you use j3o? if you use j3o you can apply material to it via SDK - SceneComposer.