HoloLite Posted February 23, 2018 Share Posted February 23, 2018 Noob question: do we have .babylon -> gltf conversion tool ? I am trying to convert some existing scene in .babylon format into gltf. Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2018 Share Posted February 23, 2018 Yes you can Thanks to our wonderful gltf serializer: https://github.com/BabylonJS/Babylon.js/tree/master/serializers/src/glTF/2.0 You can load the scene in babylonjs and then call BABYLON.GLTF2Export.GLTF(scene) Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 23, 2018 Author Share Posted February 23, 2018 @Deltakosh I just tried the api, but getting the following popup error during the api call. First I loaded the scene from .babylon format, and this step actually succeeded. The scene was displayed. Then called the converter. Here is my call: BABYLON.GLTF2Export.GLTF(scene, "mygtlft"); Quote Link to comment Share on other sites More sharing options...
Guest Posted February 26, 2018 Share Posted February 26, 2018 Can you provide a repro in the PG? @kcoley will comment soon:) Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 26, 2018 Author Share Posted February 26, 2018 @Deltakosh I just created the PG: http://www.babylonjs-playground.com/#I74IFH#4 See the console log for errors. The call to BABYLON.GLTF2Export.GLB(this.scene, "mygtlft") throws exception with the following error message: HTML1300: Navigation occurred. www.babylonjs-playground.com (1,1) BJS - [09:55:43]: Babylon.js engine (v3.2.0-alpha10) launched babylon.js (4,7860) converting to glb... eval code (13) (18,13) BJS - [09:55:46]: default material: Standard Material is currently not fully supported/implemented in glTF serializer babylon.js (4,8035) BJS - [09:55:46]: default material: Back-face culling enabled and two-sided lighting disabled is not supported in glTF. babylon.js (4,8035) BJS - [09:55:46]: SkyCarLightGlows: Standard Material is currently not fully supported/implemented in glTF serializer babylon.js (4,8035) BJS - [09:55:46]: SkyCarLightGlows: Back-face culling enabled and two-sided lighting disabled is not supported in glTF. babylon.js (4,8035) BJS - [09:55:46]: Unable to load from https://raw.githubusercontent.com/hololite/gltf-samples/master/babylonjs/car/MyScene.babylon: Error in onSuccess callback babylon.js (4,8230) WEBGL11046: INVALID_ENUM: framebufferTexture2D: Invalid or unsupported texture target babylon.js (8,11324) WEBGL11088: INVALID_FRAMEBUFFER_OPERATION: readPixels: No attachments present babylon.js (8,11779) The 'conversion done' log is never generated. Quote Link to comment Share on other sites More sharing options...
kcoley Posted February 26, 2018 Share Posted February 26, 2018 Hi @HoloLite, thanks for setting up the playground. I'll look into this now. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted February 26, 2018 Author Share Posted February 26, 2018 Sorry, the PG has been updated, please use this: http://www.babylonjs-playground.com/#I74IFH#4 Quote Link to comment Share on other sites More sharing options...
kcoley Posted February 26, 2018 Share Posted February 26, 2018 No problem! I'll load that playground . Quote Link to comment Share on other sites More sharing options...
davrous Posted February 26, 2018 Share Posted February 26, 2018 I've got a similar issue with this PG: http://playground.babylonjs.com/#QGS3UQ#2 if it can help you debugging Quote Link to comment Share on other sites More sharing options...
kcoley Posted February 26, 2018 Share Posted February 26, 2018 I found the issue and am working on a fix now. davrous 1 Quote Link to comment Share on other sites More sharing options...
kcoley Posted February 28, 2018 Share Posted February 28, 2018 I committed the fix for the export issues . I am working on a final texture conversion from specular glossiness to metallic roughness, which I plan on having completed tomorrow. I'll update when that is ready! Thanks for the playgrounds, which helped me troubleshoot this! HoloLite 1 Quote Link to comment Share on other sites More sharing options...
kcoley Posted March 3, 2018 Share Posted March 3, 2018 Specular glossiness to metallic roughness conversion was recently merged, which should support PBRMaterials. Feel free to create an issue on GitHub if you run into problems. I am tracking features for the glTF serializer here: https://github.com/BabylonJS/Babylon.js/issues/3601 Thanks! Quote Link to comment Share on other sites More sharing options...
HoloLite Posted March 3, 2018 Author Share Posted March 3, 2018 @kcoley, I've move things around in my git rep, so the scene url has changed and might break the PG in the near future. Here is the update PG with the correct scene url. http://www.babylonjs-playground.com/#I74IFH#5 I just tried the PG now, I don't see the error popup yet, but looks like the call is still throwing exception inside ? I don't see the 'conversion done' trace being logged on the console. Quote Link to comment Share on other sites More sharing options...
kcoley Posted March 5, 2018 Share Posted March 5, 2018 Hi @HoloLite, I made a few tweeks to your playground to get it to work: http://playground.babylonjs.com/#8BNBM9 To use the glTF serializer, the scene must be completely loaded first, so I added the executeWhenReady callback. Also, to prevent including the skybox in the scene, I defined a shouldExportMesh option, which excludes meshes from being included in the final glTF scene. Let me know if that makes sense. Quote Link to comment Share on other sites More sharing options...
HoloLite Posted March 5, 2018 Author Share Posted March 5, 2018 Nice work! Thanks. Yeah the callback made sense. I just ran it and use the Builder 3d to view the generated gltf. Will this be in the next alpha? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.