[solved] Problem with mesh.xml file

Hi everyone. I have a problem with loading assets. On the beginning of my project i loaded objects as obj file and I putted on it UV texture. It works correctly. Now, I wanna make some animations. I red that I have to export my Blender model into mesh.xml file, and this file put to project. So, I installed OgreXML converter. When I exported my blender model I selected the folder on my “assets/Model” directory and I checked to convert textures into png format. I got lots of file (.materials, .scene, .mesh.xml, textures in .png). So, after that I loaded .mesh.xml file into my project. Object was load, but without any textures. Maybe problem is how I’m naming files? Anybody knows what I’am doing wrong?

Should I make an UV map to mesh.xml file?

You have to create a separate material file (in assets/Materials) wich points to the .png file of your texture and add this to your node in your code (at least, that is how I did it).

Unfortunately it doesn’t work. In tutorial (Assets tutorial) is writing: “Export your 3D model in OgreXML format (.mesh.xml, .scene, .material, .skeleton.xml) and place it in a subdirectory of assets/Models/.” So I think that I don’t have to create different subdirectories.

I have many material files (created by blender). For example here is main material file:



// blender material: cholpka

material cholpka

{

receive_shadows on

technique

{

pass cholpka

{

ambient 0.800000011920929 0.800000011920929 0.800000011920929 1.0

diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 1.0

specular 0.5 0.5 0.5 1.0 12.5

emissive 0.0 0.0 0.0 1.0

alpha_to_coverage off

colour_write on

cull_hardware clockwise

depth_check on

depth_func less_equal

depth_write on

illumination_stage

light_clip_planes off

light_scissor off

lighting on

normalise_normals off

polygon_mode solid

scene_blend one zero

scene_blend_op add

shading gouraud

transparent_sorting on

}

}

}




Beside that file I have few with textures, e.g:





// blender material: drzwi

material drzwi

{

receive_shadows on

technique

{

pass drzwi

{

ambient 0.800000011920929 0.800000011920929 0.800000011920929 1.0

diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 1.0

specular 0.5 0.5 0.5 1.0 12.5

emissive 0.0 0.0 0.0 1.0

alpha_to_coverage off

colour_write on

cull_hardware clockwise

depth_check on

depth_func less_equal

depth_write on

illumination_stage

light_clip_planes off

light_scissor off

lighting on

normalise_normals off

polygon_mode solid

scene_blend one zero

scene_blend_op add

shading gouraud

transparent_sorting on

texture_unit

{

texture DoorsWoodSingleOld0002_thumbhuge.png

tex_address_mode wrap

scale 1.0 1.0

colour_op modulate

}

}

}

}




And I have this texture in the same folder (all files are in “assets/Models/cholpka”).



I tried to change my main material file into ninja material file (ofcourse I changed the texture). But nothing happened, still I have a red object.

Manual also states you have to create the material after converting to .j3o, see manual at https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender.

Ok, I found solution. I have to many material files. Only one material file is needed with information about UV texture. When I saw “ninja” material file I repair this into my project.