Hello,
Im trying to export a very simple mesh that has a JPG as texture. To reproduce in Blender, use the box, apply a texture with the "Texture Button (F6)" and try to export. The exporter tells me that 0 objects will be exported when my box is textured. When I remove the texture it will export the model.
Reading the help notes gave me the impression HottBJ 0.4a has support for material/texture export. Also the tutorial mentions it is possible but doesn't explain which steps should be taken.
What am I doing wrong?
Thanks!
You have to use an uv-map to export the texture:
http://www.jmonkeyengine.com/wiki/doku.php/blenderjme_mats_tutorial
ttrocha said:
You have to use an uv-map to export the texture:
http://www.jmonkeyengine.com/wiki/doku.php/blenderjme_mats_tutorial
Thank you, that helped me alot. I must've overread that part.
One last question.. and I'm not sure if it either jME related or Exporter related.
When exporting with the texture I get the following results
Not really what I was hoping to get. The model -can- find the texture though, however its way of applying it is all wrong (when you look at the Blender screenshot).
Again, thanks for the help!
Can you provide the .blend-file and I will have a look.
Darklord said:
...
One last question.. and I'm not sure if it either jME related or Exporter related.
When exporting with the texture I get the following results
...
Not really what I was hoping to get. The model -can- find the texture though, however its way of applying it is all wrong (when you look at the Blender screenshot).
Again, thanks for the help!
I don't see anything wrong. All differences I see are accounted for by having smoothing off in Blender (a presentation-only feature not intended for exporting) and different light sources and background.
Well the thing is, when I apply a texture on a model… I get two different results.
I followed the materials tutorials twice. The section of UV mapping and texturing. Perhaps I’m forgetting to set a render parameter or something?
Anyhow, ttrocha, I uploaded the Blend here:
http://www.megaupload.com/?d=RD3PHXUG
Simple test class to load a model:
public class SimpleImport extends SimpleGame
{
@Override
protected void simpleInitGame()
{
URL modelUrl = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL, "/models/simplepane-jme.xml");
loadModel(modelUrl);
}
protected void loadModel(URL modelUrl)
{
Spatial loadedSpatial = null;
try
{
loadedSpatial = (Spatial) XMLImporter.getInstance().load(modelUrl);
} catch (Exception e)
{
throw new IllegalArgumentException("Failed to load URL: " + modelUrl, e);
}
loadedSpatial.setModelBound(new BoundingBox());
rootNode.attachChild(loadedSpatial);
loadedSpatial.updateModelBound();
rootNode.updateRenderState();
}
public static void main(String[] args)
{
SimpleImport app = new SimpleImport();
app.start();
}
}
Again, thanks in advance!
Is there no other way to upload the blend file? Make a zip and add it to your post! Megaupload suxx so much…
always says the file is not available at the moment…
ttrocha said:
Is there no other way to upload the blend file? Make a zip and add it to your post! Megaupload suxx so much....
always says the file is not available at the moment....
Here you go! :)
http://www.xs4all.nl/~apache64/JMonkey/Try2Texture.zip
Actually I'm at work now and don't have the HottBJ-Exporter here right now. But having a short look to your blend-file shows me that you didn't unwrap your model, so you don't have a UV-Map but maps the texture to uv…
This you might do to fix it: Select you model, go in edit mode, press u-key -> unwrap. Make sure to select in the uv/image-editor your image in the select-box. Using textured draw type will show you now the texture in the 3d-view as well (draw-type is the little icon in the select-box right from the selectbox where you can select edit/object/pose/etc-Mode)
Second, you should always have relative paths. (File->External Data->Make all paths relative) or when you select an image to include there is a 'relative-path'-switch somewhere…
Give it a try…
ttrocha said:
Actually I'm at work now and don't have the HottBJ-Exporter here right now. But having a short look to your blend-file shows me that you didn't unwrap your model, so you don't have a UV-Map but maps the texture to uv...
This you might do to fix it: Select you model, go in edit mode, press u-key -> unwrap. Make sure to select in the uv/image-editor your image in the select-box. Using textured draw type will show you now the texture in the 3d-view as well (draw-type is the little icon in the select-box right from the selectbox where you can select edit/object/pose/etc-Mode)
Second, you should always have relative paths. (File->External Data->Make all paths relative) or when you select an image to include there is a 'relative-path'-switch somewhere...
Give it a try...
Oh yeah! :D
Thanks to your extensive help, I solved this problem!
Many, many thanks!