Blender loader first load problem

I have a strange problem. When I load a blender file directly with the assetManager on application load, I get a model with a n unshaded material applied. However, when I reload the app state that loads and attaches the node child (just detach appstate and then attach appstate again), the model is loaded correctly with its diffuse colour and specular colour. I checked the blender file and ‘shadeless’ is unchecked. And there are no textures attached.

It seems to only load the correct material settings when loading from the asset cache.

Any ideas what could cause this? Im on 3.1-beta1.

Ok, Ive discovered something.

This line causes the behaviour as defined above:

Node sceneParent = (Node) assetManager.loadModel(“Models/file.blend”);

Whereas this line causes the unshaded model to get loaded no matter home many times the appstate gets reloaded:

Node sceneParent = (Node) assetManager.loadAsset(new BlenderKey(“Models/file.blend”));

I guess the defaults for BlenderKey must be different than when ModelKey is used. Weird.

I’ve discovered what the problem is. I had a lamp in my blender file. Adding it to the scene made my model look like it was getting its material changed on second load. However, it was only added/activated when attaching the scene node a second time to the root node after first detaching it. Removing the lamp from the blender file, or digging into the scene to extract the model object itself seems to do the right thing.

Im still new to JME so Im not 100% sure how the lights gets added into a scene from a blender file.