Closed tylerchurch closed 4 years ago
Hey thanks for reporting! Basically, the gltf exporter of the editor just uses the gltf serializer available in the babylonjs serializers library. Maybe @bghgary can help?
The tagging system is used only internally by the editor to know what it has to save when you click « Project -> Save Project »
glTF 2.0 core spec does not support lights. There is an extension being worked on for lights that is implemented in the loader as an experiment. We can add support for exporting lights once the extension is ready. FYI @kcoley
Hey! Thank you so much for the quick response. I will pursue some other way of handling lighting.
Or is there a smart solution I can implement in the editor ?
@julien-moreau It would be helpful if there was some JSON export or just a straight up code export that listed out the lights (and anything else that doesn't fit into GLTF) and then I could process that somehow in the program I have that's loading the scene.
Another thing we're looking at is the Blender plugin http://doc.babylonjs.com/resources/blender and it seems like that has the same issue with lights, for presumably the same reason.
@tylerchurch, just added an option to export the serialized lights in a separate file (lights.json). Then, you'll have to call BABYLON.Light.Parse for each light in the json file. Will deploy ASAP
@tylerchurch deployed! Are you using the windows local version of the OSX one ?
@julien-moreau awesome! Thank you! I'm using the windows local version.
Updated :) If you want to use the feature right now, please re-download the installer. A new update is coming soon also which fixes some other bugs
Deployed :)
so it loads lights now?
Pinging @bghgary to know if the GLTF spec has been updated and know if it now supports lights
The KHR_lights_punctual glTF extension is supported by both the serializer and the loader.
Hello,
I've tried both the editor on http://editor.babylonjs.com and I have 2.3.0 installed locally, and I noticed that when I export as .glb or .gltf I don't see any lights get loaded when I try to load the scene in the Babylon.js application we've written.
To test the simplest possible case, I did the following:
This is what the simple scene looks like:
Opening the resulting .glb file and saw only this at the top:
Working with a more complex scene that included meshes and other things, I saw this JSON data get populated with the things I had added, so the fact that the lights are missing seems suspect.
I took a peek at the code, and saw this:
( This is from https://github.com/BabylonJS/Editor/blob/08d1e28cfee20dd486e082129b3c09c203144885/src/editor/scene/scene-exporter.ts#L441 )
And I can't help but wonder if maybe the
added
tag somehow isn't on the light? I have no idea how this tagging system works though so I'm not really sure how to debug this further.If I'm doing something wrong or if there's any additional information I can provide, please let me know! Thanks!