Trying to get ogre mesh models to work in my program using JMonkey 3. I created them using Blender 2.57, but when I wanted export them I could not do so in this version, so I am using Blender 2.49 as well for the purposes of exporting.
So I open up the .blender file and select the OGRE option and do as I am directed in the tutorial ‘Hello Assets’. What I get is a mesh.xml and a .material file. I then export these into the same directory in eclipse (as is the case with the Ninja model in the tutorial referred to above) within my Jmonkey project and find that when I run the program I just get a 3D model that is red all over there does not seem to be any material or texture. All I do is add the spatial to the root node and nothing else no materials or textures (that does not seem to sork either) as I attempting to copy the code as set out for the Ninja model in ‘Hello Assets’.
you have a something.mesh.xml and a ****.material, right ?
is something and **** the same ?
sometimes I have Cylinder.mesh.xml and scene.material → all red
I renamed scene.material to Cylinder.material and it works
also I had a problem which I havent solved 100% yet, it might also be your problem:
I made the mesh in 2.57 , a lot of material + texture then I imported to 2.49 and export —> some texture missing, material is all messed up. → I remove all material, make new material, without any texture, import it in 2.49 and export → it works (mesh has color like in material, but no texture)
I dont know which case is yours, but you can try.
also sometimes you get no errors but the export failed somewhere , you can try to export it a few times
Yes, I renamed the .material file to match that of the .mesh.xml file and sure enough it worked. Many thanks.
Thinking about the texture problem: I have not yet tried to export any models that I have added texture to (Blender 2.49 keeps closing when I try to open the .blender file I have with teture added). However, from looking at the jme tutorials and what they have given as samples there is a possiblity based on two things that I have seen: firstly, I have had a look at the sample files in jme3testdata.jar which is one of the libraries thst come with the jme 3 download and looked at the ninja model and I have noticed that there is a jpeg file alongside the .meterial and .mesh.xml. Secondly, also jpegs are mentioned in the Hello Assets tutorial and are the file type used when texture is added explicitly in the code.
This seems to suggest that when the ogre export is done there should be jpegs alongside the .material and .mesh.xml files. Bear in mind that I am a beginner and could be barking up the wrong tree but in case this relates to your problem it is worth mentioning. As to how to get ogre to export jpegs as well I do not at present know but if I find out then I will comment further.
there is an option in ogre exporter called : copy texture
if you have texture (correctly) then normally you will get the
***.mesh.xml, //mesh data ?
***.skeleton, // animation
***.jpg or ***.png //texture
but I think I never exported a mesh with texture
and I still dont know if I have a normal map or bump map then how many jpg or png file I will have. and I dont know if jme support them.
The texture may not be packed in the blend file to be copied btw.
The ogre exporter only supports color maps actually, since materials are coded as shaders in OgreXML all other maps shader names must be mapped to jME3 shaders and since the names are not standardized this has to be done for every type of exporter (that supports maps other than color maps).