Ambient lighting and blender imports

I’ve been importing models directly from blender but I noticed the ambient lighting is not importing. Any face not facing a light is solid black. Adding ambient lights in code or scene doesn’t help either. Anyone have a work around for this or do I need to convert my blend files to another format such as obj ?

My understanding is that blender has no way of setting the ambient value for a material… so you must mean something else.

My guesses because I’m feeling lucky:

  1. you are running JME 3.0
  2. your material has ‘UseMaterialColors’ turned on but has no ambient color set.
    3)…or you have no ambient light in your scene.

Blender 2.75a does have a value setting for ambiance.

I am using 3.0 , does 3.1 fix this ?

When importing blend files it only gives me a .j3o and the .png file I’m using as a texture. My model is texture wrapped and contains only 1 texture.

I added an ambient light and adjusted the global ambiance to no avail.

3.1 probably does fix this as it picks a default ambient material color that isn’t black.

In the mean time, open the model in the scene editor, ‘generate’ its j3m material file, edit the material to have a non-black ambient color. (Even in 3.1 you might have to do this as the blender loader might always set ambient to black… I don’t know if it leaves it empty or sets it.)

This is where I am lost. I don’t see an option in the scene editor to generate a material file.

Select the geometry. Look over on the right at the material drop down. Find the option that says “Generate material”.

…make sure you save the model when done.

Once you select geometry there is no option to generate material. In the material properties I get a drop down box that allows me to select three preset shaders and that is all. Perhaps this is a 3.1 feature , maybe I need to try it out.

No, it’s in 3.0… I haven’t even tried that in 3.1 yet.

I think you might be looking at the wrong drop-down.

I found it. Is there a way to ad the material in the scene editor or do I have to manually apply it by code ?

What do you mean ‘add the material’? As soon as you selected to generate the j3m it was attached to that geometry… you just have to save the model as I already said.

Then you can modify the j3m and when you load the model it will have the changes.

I found the problem. I was was adding the model into a new scene. Apparently after generating the file you can’t delete then ad it to the scene. You have to start a new scene.

The generate material option also seems to show up selectively. I’m not sure why it only shows up sometimes.

Well, it won’t show up after a material has been generated, I guess… but it should always show up before then, ie: if it doesn’t already have a j3m.

Or once you have a j3m you like you can just set it directly in the scene instead of or in addition to the model. Just select the mode’s geometry in the scene and select the j3m file from a different option in that same drop-down.

Either way it’s a pain in the arse. I’m going to change up the blender default script tomorrow to have 0.9 ambiance setting on save by default. No matter what you adjust the ambiance to it saves it to 0 for some reason.

You could always set the ambient level programmatically… then you know they will all be the same.

The global ambient level has no effect when the materials are all set to black unless i"m missing something.

I mean traverse the scene and set the ambient color of all materials.

Else what would I have meant by “then you know they will all be the same”? Would “all” be if I meant the ambient light?

Too much work my friend when I can simply change the blender script and have all my models light properly. I’m so frustrated with blender. Previously I used an older modeler that exported perfectly into obj file into jmonkey flawlessly , after a long break I came back and decided to pick up blender. Sure blenders learning curve is high and the program is quirky but all in all it’s worth it.