Okay so I checked the sources of current Jme3, the new one at git and Blender sources and I found these things:
This is how the jme3 SDK does the ambient color import in MaterialContext.java
float r = ((Number) structure.getFieldValue("ambr")).floatValue();
float g = ((Number) structure.getFieldValue("ambg")).floatValue();
float b = ((Number) structure.getFieldValue("ambb")).floatValue();
float alpha = ((Number) structure.getFieldValue("alpha")).floatValue();
ambientColor = new ColorRGBA(r, g, b, alpha);
From Blender sources I found the place where those values are inited, in convertblender.c line 5182:
void RE_Database_FromScene(...) {
...
copy_v3_v3(amb, &re->wrld.ambr);
...
}
Now what does this mean. Well it means that the material ambient color is set from the world ambient color only when this method is executed in blender. In other way, this pretty much mean that the culprit is in blender sources and not in the jme importer.
Well, the solution is quite simple. All we have to do now is to execute that method. And the simplest one I’ve found is to simply change Viewport Shading to rendered or render your scene at least once. That will set the material color to the ambient color of the world.
Other solution would be to overwrite the ambient color in code:
Spatial m = assetManager.loadModel("Scenes/male-body-wrong-ambient.j3o");
((Geometry)((Node)((Node)(((Node)m).getChild(0))).getChild(0)).getChild(0))
.getMaterial().setColor("Ambient", ColorRGBA.White);
Now since i checked how the newer version of jme does things as well, I will comment on those as well.
In the MaterialContext.java:
ambientFactor = ((Number) structure.getFieldValue("amb")).floatValue();
material.setColor("Ambient", new ColorRGBA(ambientFactor, ambientFactor, ambientFactor, 1f));
Well, simply speaking that’s an obvious bug of sort, as one float is used for a color.