Mesh + material is fine, but how to get material on j3o

I made my first advanced model in blender and was able to UV map, paint and load it into JME

Easy loading the .mesh.xml and the material comes with it, no additional work.

I also have the model converted into .j3o but when I load that, the material does not join in.

How can I take my .material from OGRE export, and get it into JME on the .j3o model ?

Are you moving the actual images with your model?

Otherwise:

One way to ensure this is not only there but being displayed the way you would like would be to:

  1. Create a j3md with the textures/setting you want
  2. Open the j3o in the scene composer
  3. Select the new j3md as the material
  4. Save you j3o

This may be the preferred method, as texture don’t look quite the same in JME due to the shaders being different. Making your own j3md allows you to adjust settings to either match what you saw in blend, or adjust the material to what you wanted and didn’t see in Blender.

I can load the j3o file in JME and put the same texture on it, but the UV mapping is lost and the texture is just “randomly” painted on the model which makes it wrong.

I see this all over the place about converting .blend to .j3o and importing assets, but that’s not available in my install of JME. Something wrong with my JME?

https://dl.dropbox.com/u/2974336/disabled.JPG

UPDATE: something was in fact wrong with my install of JME and has now been resolved.
I have some similar issues with android though.

@t0neg0d said: Are you moving the actual images with your model?

Otherwise:

One way to ensure this is not only there but being displayed the way you would like would be to:

  1. Create a j3md with the textures/setting you want
  2. Open the j3o in the scene composer
  3. Select the new j3md as the material
  4. Save you j3o

This may be the preferred method, as texture don’t look quite the same in JME due to the shaders being different. Making your own j3md allows you to adjust settings to either match what you saw in blend, or adjust the material to what you wanted and didn’t see in Blender.

I cannot open it in the scene composer.
How to do this?

UPDATE: I couldn’t use the scene composer because of some JDK problem on my PC. I have found it now and i’m trying to figure how to use it. Opening it is no longer a problem though.

@t0neg0d said: Are you moving the actual images with your model?

Otherwise:

One way to ensure this is not only there but being displayed the way you would like would be to:

  1. Create a j3md with the textures/setting you want
  2. Open the j3o in the scene composer
  3. Select the new j3md as the material
  4. Save you j3o

This may be the preferred method, as texture don’t look quite the same in JME due to the shaders being different. Making your own j3md allows you to adjust settings to either match what you saw in blend, or adjust the material to what you wanted and didn’t see in Blender.

I would love to do this, but opening my j3o in the scene composer and playing around, I cannot find anything such as “select material”. Where or how do you do this?

@ettavsdro said: I would love to do this, but opening my j3o in the scene composer and playing around, I cannot find anything such as "select material". Where or how do you do this?

Beneath the project explorer you will see a window that will have a tree view of the object you load into the scene explorer. Select this and the properties window will display all sorts of info about the Node. Towards the bottom you can select the material.

I hope that’s a good enough explanation, as I’m not entirely sure what the panel under the project explorer is called.

Thanks, that is a very good enough explanation. Main problem was my property window wasn’t open, so I never saw that.

this picture is for you!
https://dl.dropbox.com/u/2974336/ghost%20scenecomposer.JPG

However, I had the impression that the above would make the matreial included in the j3o file so that I don’t have to load the material with code.
This seems wrong since commenting out the material code below just leaves a non-textured model when running.
(Not commenting them gives me the result I want, both on Jme and on Android)

Am I doing something wrong?

Node player_geo = (Node)assetManager.loadModel(“Models/ghost3/ghost3.j3o”);
// playerMaterial = assetManager.loadMaterial(“Models/ghost3/ghost3.j3m”);
// player_geo.setMaterial(playerMaterial); //den blir helt svart annars

@ettavsdro said: Thanks, that is a very good enough explanation. Main problem was my property window wasn't open, so I never saw that.

this picture is for you!
https://dl.dropbox.com/u/2974336/ghost%20scenecomposer.JPG

However, I had the impression that the above would make the matreial included in the j3o file so that I don’t have to load the material with code.
This seems wrong since commenting out the material code below just leaves a non-textured model when running.
(Not commenting them gives me the result I want, both on Jme and on Android)

Am I doing something wrong?

Node player_geo = (Node)assetManager.loadModel(“Models/ghost3/ghost3.j3o”);
// playerMaterial = assetManager.loadMaterial(“Models/ghost3/ghost3.j3m”);
// player_geo.setMaterial(playerMaterial); //den blir helt svart annars

This should load properly if the model is saving correctly after you select the MatDef file… however, If you plan on reusing Models with different textures, it’s not a bad idea to write a quick material handler. This way if you ever decide to do something unexpected (like apply shader based fog, you can swap out a uniform of the shader globally with a single method call.

You have also to apply the J3M material to your geometry inside the scene composer. And save it back. Otherwise, it sticks with the imported one, and this is not that good. (from my experience)