I’ve gotten this in blender 2.63 and 2.62. I’ve tried to get OgreXML import working but the tutorial is not a tutorial, it’s a vague checklist and some pictures which do not seem to refer to either of the versions of Blender I’ve used. I’ve installed the CommandLineTools and the exporter script, but exporting just gives me a pile of errors:
When I try to import blender 2.62 files I get an error
Loading obejct: Camera
Camera created (W: 640, H: 480)
Loading obejct: Cube
Importing mesh.
Loading material.
Reading texture from file: //......Models..AlexiosassetsModels......Modelswalnut_dark.jpg
Trying to write asset failed, asset data null!
Import failed?
When i try to import blender 2.63 files I get a .j3o file with no object or mesh or whatever in it. The scene viewer just shows the reference arrows with no object or wireframe visible.
@michaellinke said:
When i try to import blender 2.63 files I get a .j3o file with no object or mesh or whatever in it. The scene viewer just shows the reference arrows with no object or wireframe visible.
U turned on the light and looked at the SceneExplorer?
When I run the game with a .j3o made from a blender 2.63 file, the chest does not appear.
I’ve figured out part of the problem. The holes in the model were because certain polys were facing inward. I flipped those. The texture is still borked and actually flickers if I move around.
I had the same. It was caused by the texture location in Blender. Mosty likely, you have Blender save the .blend file somewhere, then you copy it to your projects assets, right?
What you should do (at least that worked for me) is the following:
In Blender, save the .blend file into your /assets/models folder. Also, save your texture ‘Modelswalnut_dark.jpg’ in the same folder. Now in Blender, you will have to reload your texture file , but now from the /assets/models folder (make sure yo do this in Blender in both the UV/Image editor as well as in the textures menu).
As you can see in the error, ‘Readding texture from file: //……Models…AlexiosassetsModels……Modelswalnut_dark.jpg’, the importer tries to load the txture from a strange directory. When you do it like I suggested, the location of the texture in the texture menu of Blender will look like this: //Modelswalnut_dark.jpg.
If you want to store the .blend file somewhere else then in your /assets folder, this should be possible, as long as you make sure the texture file is in the same folder, and when importing into JME, put the texture file in the folder where the model goes upfront.
Are you using multiple separate meshes in Blender? If so, create a material and texture file for each mesh (all with there own UV-maps and UV-textures). And in JME, create a j3m for each material and set it to the individual objects…
I was initially using multiple textures, but after failing to get ogre to work, I simplified to a single material, single texture version The top three screen shots above are one material, one texture.
When I export a .obj, blender also gives me a .mtl file which I can’t seem to import or convert into anything in jme.
To better illustrate what’s going on with the textures, I changed to the following texture:
There are some reference frame type glitches in the floor and background on the avi file, but the object in question, the treasure chest, is always centered and IS NOT glitched in the video compression process. This is exactly how it looks.
You have to create your own j3m file in which you set the texture to the DiffuseMap. Then set this material to the .obj. If I remember correctly, there was no need for this .mtl file in JME.
Your UV mappings look pretty scrambled to me. Have you tried:
Applying all the modifiers in blender before export (save the pre-applied model before doing this)
Updating to Nightly (see below)
Importing using the blender importer
(optionally)Applying your own created material with the texture in it
Please note that blender 2.63 has a completely different internal format to store meshes which breaks a lot of tools. The latest nightly SDK has a blender importer that fixes support for 2.63 meshes and also at the same time some uv and normal mapping problems I was seeing.