dsman Posted February 23, 2018 Share Posted February 23, 2018 We are trying to build simple Cordova/ionic based Babylon model viewer. We are downloading and storing model files at runtime to App's folder in primary storage ( ///storage/emulated/0/android/data/com.vizmonk/files/code/front/models/ ) Now the problem is babylon.js is not able to load the .babylon field from that location. Following is console error and stack trace. Same file if accessed using ajax call and printed on the console it works fine (content is printed in the console in the screenshot below. ) Quote Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2018 Share Posted February 23, 2018 can you check which url is used by babylon.js to load your file? (using the network tab in f12 tools) This may come from the url not starting with a scheme Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 23, 2018 Share Posted February 23, 2018 I checked my cordova project. I do not use .babylon files, but do load textures. I just added an 'img' sub-directory to 'www', then reference textures relative to 'www', where index.html is. That is './img'. Your description does not even remotely resemble mine. Are you going handle all your reading in a platform (iOS, Android, Windows) way? Quote Link to comment Share on other sites More sharing options...
dsman Posted February 23, 2018 Author Share Posted February 23, 2018 @Deltakosh We tried both types of URL. The one starting with file ( file:///storage/emulated/0/Android/data ... etc) and without it ( ///storage/emulated/0/Android/data ... etc). @JCPalmer Yes. We are going to store model files at runtime, so it can't be placed in www or asset folder. And it has to be stored/read in a platform-specific way. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 26, 2018 Share Posted February 26, 2018 what url does bjs try to load? you can get it from the f12 network tab Quote Link to comment Share on other sites More sharing options...
dsman Posted February 28, 2018 Author Share Posted February 28, 2018 @Deltakosh No matter if we use the path beginning with "file:///storage/emulated....." or "///storage/emulated/..." or "/storage/emulated/...." The path in the network tab of chrome dev tools is: "file:///storage/emulated/0/android/data/com.vizmonk/code/front/models/3879316/3879316.babylon" Quote Link to comment Share on other sites More sharing options...
Guest Posted February 28, 2018 Share Posted February 28, 2018 And why is this url not working? Quote Link to comment Share on other sites More sharing options...
dsman Posted February 28, 2018 Author Share Posted February 28, 2018 @Deltakosh Well, that's precisely my question. You can see in the screenshot above. An ajax function call using jquery to the same URL is able to access .babylon file and print its content. While below it, you can see the babylon.max.js is showing the error saying "unable to load from .. " Quote Link to comment Share on other sites More sharing options...
Guest Posted March 1, 2018 Share Posted March 1, 2018 This is weird as BJS is only using xhr internally Can you reference non minified version of bjs and try to dig into it? I will need a repro if you want me to help further 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.