Texture is not being exported with Mesh

I am following these procedure,


  1. Created a plane.
  2. Created a Material.
  3. Created a texture slot
  4. Setting Texture Type to Image loaded a texture.



    When i try to export as *.obj the textures are exported as they should, but, when I use Ogre Mesh Exporter the Textures are not being exported.

    I have followed the jMonkey Platform video demonstration, every thing is just like the video, but just the texture is not exporting.Even the Material file dont have any info about texture.



    I am using Blender 2.49b and Python 2.6.6.Everything else is working fine. :frowning:



    what can I do to solve this?

    ----



    How do jMonkey handle the *.mesh file that are exported from Maya using Ogre Mesh Converter?How can I use those files?





    If i try to create compound collision shape using Obj/j3o file then, i get the following error

    “Geometry cannot be cast to com.jme3.scene.Node”



    is it because, only compound node can be created using *.scene file?



    I wanted to attach the blend file with this post, but i dont find a way?is there anyway to attach a file here?

Ok, In blender, in your mesh’s material, type “TexFace” in Material tab. In texture tab make sure your texture are selected, go to Map input tab

and type UV. Now go to Buttons WIndow menu - Editing(f9) - Texture Face tab - Type tex - and type copy to copy the uv texture to your mesh.

Ok now you can export your mesh with its material. If not, ask help again :slight_smile: .

For the texture error, make sure “Copy Textures” is selected in the Ogre exporter options, also make sure “Rendering materials” option is selected.



For maya and 3dsmax .mesh files, I added an issue in the issue tracker to add support for it in jMP:

http://code.google.com/p/jmonkeyengine/issues/detail?id=220

Outside of jMP, you will have to use OgreXMLConverter utility to convert them into mesh.xml files.



For the geometry cast issue, make sure you’re using the common superclass “Spatial” instead of Node or Geometry. If a model contains only 1 mesh, it could import as a geometry and not as a node.

Momoko_Fan said:
For maya and 3dsmax .mesh files, I added an issue in the issue tracker to add support for it in jMP:
http://code.google.com/p/jmonkeyengine/issues/detail?id=220
Outside of jMP, you will have to use OgreXMLConverter utility to convert them into mesh.xml files.

Dude, the feature was in *hours* before you requested it :p

@iamcreasy Ogre exporter needs proper UV coordinates to export material correctly, check that step too.

Hi!

I got a similar problem - I have a model “farm.blend” - one mesh, two materials, one material is a simple color-material (for the fence around the farm, to be accurate ;D) and the other is made with UV mapping.

I followed glaucomardano’s tips, but it didn’t work.

This is the material file:


material Material
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 0.937130
diffuse 0.800000 0.800000 0.800000 0.937130
emissive 0.000000 0.000000 0.000000 0.937130
scene_blend alpha_blend
depth_write off
texture_unit
{
texture farm_Plane.png
tex_address_mode wrap
filtering trilinear
colour_op modulate
}
}
pass
{
ambient 0.0 0.0 0.0
diffuse 0.0 0.0 0.0
specular 0.500000 0.500000 0.500000 0.937130 12.500000
scene_blend add
depth_write off
}
}
}
material fence
{
receive_shadows on
technique
{
pass
{
ambient 0.153708 0.156828 0.058332 1.000000
diffuse 0.245933 0.250926 0.093331 1.000000
specular 0.500000 0.500000 0.500000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
}
}
}


Aaaand here are two screens, one showing the model in blender and one of how it looks like in jMonkeyPlatform:
Blender: http://imgur.com/86n7T
jMonkeyPlatform: http://imgur.com/qPyKg

Please, help :,(

It seems there are two passes created for the first material. Can you show how you set up the UV mapped material in Blender?

Make sure you saved your textures and selected the “Copy Textures” button in “OGRE Meshes exporter” script window before exporting. For more details look at the image below:







I hope it will be useful for you ;P.

Hmm, seems like I don’t understand Blender UV Textures that much^^ I tried to export it several times with different settings, and two passes were created for the material with the UV Texture every time.

I solved the problem by deleting the second pass in a text editor, and it worked.

I have not the slightest idea why this happened, but I will look at the material file of all meshes before converting from now on. Thx for your help!