I just began working with JME and Blender a few weaks ago, but i spent a lot of time on it especially on Blender.
So i wanted to import a minion which I designed into JME. The textures didn’t show up, simple reason, I had more than one texture and UV map.
I decided to begin with an easier task, with a cube generated in JME and the monkey had from Blender.
I created an unshaded material and set the texture with the assets loader using a simple picture.
On the cube it showed the picture on each side which is fine.
But on my monkey had it doesn’t show up, although I UV unwrapped the model.
I read the tutorials but can’t find my mistake. I hope someone can help me. MyModel.blend
Here is my Code:
Material mat_default = new Material(assetManager,
"Common/MatDefs/Misc/Unshaded.j3md");
Texture tex = assetManager.loadTexture("Textures/Wanderung_ueber_den_aktuellen_Sternenhimmel.jpg");
mat_default.setTexture("ColorMap", tex);
Spatial brett = assetManager.loadModel("Models/TestMoneky.j3o"
+ "");
brett.setMaterial(mat_default);
Geometry cube1Geo = new Geometry("My Textured Box", new Box(1f, 1f, 1f));
cube1Geo.setLocalTranslation(new Vector3f(-3f, 1.1f, 0f));
cube1Geo.setMaterial(mat_default);
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
rootNode.addLight(sun);
rootNode.attachChild(brett);
rootNode.attachChild(cube1Geo);
On the cube it showed the picture on each side which is fine.
But on my monkey had it doesn’t show up, although I UV unwrapped the model.
I dont get it, did your cube shows or not ???
First line you said it shows ok, second you said it dont shows ?
Did you import the default blender cube ?
Are you using an compatible blender version ?
This is true. But I would have thought importing the .blend would still import the UV map properly, and he created his own material, so I am not sure what is going on there.
Regardless that is the issue, since I exported the monkey head with blender to an .obj file, and using your code it works as expected in JME
Thank you guys for your help, now i can spent my time on learning more about jme/blender and I have no longer to think about this problem. I will stay away from cycles when I am designing a game model now.
Here is my final monkey head with eyes from my minion