[SOLVED] Export Lights from Blender (Probleme with getLocalLightList method )

Escuse my English,
When I export Blender from the lights, these appear correctly in the scene and also in JmonkeyEngine SDK Editor. Only when I try to get the Light objects from the getLocalLightList method, the retrieved list is empty. Yet the light works well.
On the other hand, when I instantiate a PointLight or SpotLight object in the code and attach it to the scene with the addLight method, the getLocalLightList method returns the number of light added.
Is it normal for the getLocalLightList method to return 0 when lights are exported from Blender (with the OgreMesh export)?

Thank you in advance for your answers


Check the tree view in the SceneExplorer.
JmonkeyS lighting only affects objects which are a child of that node.

This means all lights are attached to the models rootNode but you need to move them up the hierarchy if they should affect more than that.

Your Method returns an empty list since you picked the wrong node. Get World Method should be available though

RootNode.getWorldLightList (). Size () also returns 0. However, the PointLight is in the scene. I can not even move it

One stupid question: Did you attach the model to the root node, or another node which is attached to the root node?

To build that tree in the SDK, the SDK is just using getLocalLightList() to find the lights on that spatial.

So they are there. I suspect there is another missed assumption somewhere in your code that is hidden from us.

Way easier… the light isn’t attached to the engines rootNode but the models rootNode aka what loadModel returns aka Scenes/…

You would need your own Code to remove the lights and add them to the rootNode which you might not want for Performance reasons

I found my problem.

I retrieved the list of lights from the rooNode and not from the Spatial scene added to the rootNode.

Thank you for your answers.