Adrian3D Posted August 8, 2018 Share Posted August 8, 2018 Hello Babylon community, I have been working with the BABYLON.GLTF2Export feature (which is by the way great to have!!!), and noticed an odd behavior of which I am not sure if it is intended. Check out this playground: http://www.babylonjs-playground.com/#1GXSPK#16 It will create a simple scene with a texture and download the following 3 files to your computer: MyFile.gltf MyFile.bin _textures_BJS-logo_v3.png.png So texture image files are renamed during export by their folder path and file extension (in our example from "./textures/BJS-logo_v3.png" to _textures_BJS-logo_v3.png.png ") If I then try to open / drag and drop these in the sandbox https://sandbox.babylonjs.com, I get the following error message: #/images/0/uri: Failed to load './textures/BJS-logo_v3.png.png': 0 Changing line 169 in the file "MyFile.gltf" From: "uri": "./textures/BJS-logo_v3.png.png" To: "uri": "_textures_BJS-logo_v3.png.png" makes it work again in the sandbox and other software. Maybe the intention here is to indicate with "_textures_" that the image texture was originally in the sub-folder texture, but you cannot open the gltf-file any more like that. In my opinion the BABYLON.GLTF2Export should either Leave the texture file names as is (e.g. "./textures/BJS-logo_v3.png") so that as a user I have to save the gltf in the correct folder (typically relative to the Babylon HTML-app) and NOT include them in the export (i.e. only two files are downloaded), or Include the textures in the export but fix the uri to the correct relative value. Just a proposal to save others the time I spent figuring this out. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 8, 2018 Share Posted August 8, 2018 Pinging @kcoley Quote Link to comment Share on other sites More sharing options...
kcoley Posted August 9, 2018 Share Posted August 9, 2018 Hi @Adrian3D. Thanks for flagging this issue! This is definitely a bug and the intention is for your second proposal to be the expected behavior, where the file name is corrected in the glTF file. I will work on a fix and update when completed. Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Adrian3D Posted August 9, 2018 Author Share Posted August 9, 2018 > I will work on a fix and update when completed. Awesome. Thank you for that. Quote Link to comment Share on other sites More sharing options...
kcoley Posted August 9, 2018 Share Posted August 9, 2018 Hi @Adrian3D, the change has been merged to master. It turned out to be a behavior with the browsers, where Chrome replaced the slashes with underscores, whereas Edge tried to keep the original slashes but had issues actually downloading the textures. To make the export behavior consistent, I changed all slashes and dots to underscores. Quote Link to comment Share on other sites More sharing options...
Adrian3D Posted August 13, 2018 Author Share Posted August 13, 2018 > To make the export behavior consistent, I changed all slashes and dots to underscores. Great. Tested with http://www.babylonjs-playground.com/#1GXSPK%2316 and it's working now. Thank you so much for your help. Marked topic as solved. 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.