Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My question here is similar to this since I'm using jmonkeyengine and I'm looking for models and scenes to populate my 3D world

Open-source 3D models easily usable in OGRE3D/jMonkeyEngine

When I export from blender to ogre using the blender2ogre add-on, I'm not getting anything besides a scene most of the time and when I get a mesh I never get a material. Is there something wrong with my export procedure or what else could I be doing wrong?

Update

I can export the basic cube from blender to ogre but when I download a model and try to export it I don't get the meshes.

Update 2

I tried again and selecting the model in Blender does the difference like the answer here says. I can export an alien and get the mesh and material:

enter image description here

I rename the files:

$ ls workspace/DungeonWorld2/assets/objects/creatures/alien/
Cube.001.mesh          Material.002.material  Material.005.material
Cube.001.mesh.xml      Material.003.material
Cube.001.skeleton.xml  Material.004.material
dev@dev-OptiPlex-745:~$ ls workspace/DungeonWorld2/assets/objects/creatures/alien/
alien.mesh          Material.002.material  Material.005.material
alien.mesh.xml      Material.003.material
alien.skeleton.xml  Material.004.material
dev@dev-OptiPlex-745:~$ 

But how do I actually load the material since the alien now turns up in the game with no material but it does render the mesh:

enter image description here

    Spatial model3 = assetManager
            .loadModel("objects/creatures/alien/alien.mesh.xml");
    model3.scale(0.3f, 0.3f, 0.3f);
    model3.setLocalTranslation(-40.0f, 3.5f, -20.0f);
    rootNode.attachChild(model3);
share|improve this question
1  
Hum I do not have particular problems exporting from Blender to Ogre3D engine. What Blender and blender2ogre versions do you use ? –  Valkea Jul 27 '12 at 17:04
    
@Valkea Thank you for the comment. It appears that one must select the model inside blender to get the mesh and material and not just the scene. Now I get the meshes but I don't get the material so I've gotten forward and I've updated the question accordingly. –  909 Niklas Jul 28 '12 at 1:51
add comment

1 Answer 1

up vote 3 down vote accepted

Ok, as exporting Blender scene and meshes to Ogre using blender2ogre module does works fine for me, I will try to run a very simple test in order to help you point out what is going wrong on your side.

So in order to get something very simple to compare with, I will export the initial Blender scene (the one with the simple cube) without changing anything.

  1. If I unselect the cube and export the scene using the Ogre3D blender module (default settings) I get the following file(s):

    • test.scene
  2. If I select the cube and export the scene using the Ogre3D blender module (default settings) I get the following file(s):

    • test.scene
    • Cube.mesh
    • Cube.mesh.xml (useful to convert to older Ogre mesh formats)
    • Material.material

The .scene files must be parsed in the code beside the Ogre engine, but the .mesh files can be used directly with or without the .material files.

Obviously, at that point I can see only two reasons to your problem:

  • whether you have a problem with the way you select your scene content before exporting
  • or with you softs version (Blender 2.6.3 + blender2ogre 0.5.5 doesn't works for me for instance)

This quick test was done under Linux with Blender version 2.6.3 and blender2ogre version 0.5.7-preview

If you can, try to make this simple test, and we will see if we can help you further.

share|improve this answer
    
Many thanks! Selecting / unselecting seems to have been my problem. Now I can export the mesh and the material but the rendering in the game won't render the material, I still have some to go to make to object appear complete in my game, please see my updated question about where I'm at. Thanks a lot! –  909 Niklas Jul 28 '12 at 1:53
1  
Did you checked the error log file ? (I don't know if there is one with jmonkeyengine). It should give you some useful informations. From what I can see, the problem could be that the material is unable to find the textures files (jpg, png, etc.). Are you sure they are at the right place (if the materials use textures indeed) ? –  Valkea Jul 28 '12 at 3:06
    
I try basic models which don't use textures and at import these generate many materials files and it seems that jmonkeyengine only support only material per mesh. However, its maual says that it can import .blend files directly but as I try that I get a run-time error. But at least I got forward now and understand more. –  909 Niklas Jul 28 '12 at 3:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.