With .glb files I get "Error: “Unexpected magic: 1852139298”
And with .babylon files I get "SyntaxError: “JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 10 of the JSON data”
There is a problem though now. .babylon files load correctly both in playground and in my local server that I start using npm.
I can’t load a glb file though for some reason both in playground and in my local machine. I get a Not allowed to load local resource: file://chair3.glb/
I thought that I was missing the import "@babylonjs/loaders/glTF"; but I have it there and still.
You are still a God to me though.
[EDIT] I converted the Chair3.glb file into Chair3.babylon file and for some reason I still get the same error about not being able to load local resource and the same Chair3.babylon doesn’t work in the playground too. I think there is something with the file itself.
The candle.babylon file loads correctly for example both local and in the playground. I tried Boombox.glb in playground and it doesn’t work too ! Giving me this :
task failed Unable to import meshes from file:BoomBox.glb: Error status: 0 - Unable to load file:BoomBox.glb RequestFileError: Error status: 0 - Unable to load file:BoomBox.glb at t [as constructor] (https://preview.babylonjs.com/babylon.js:16:577984) at new t (https://preview.babylonjs.com/babylon.js:16:578378) at XMLHttpRequest.g (https://preview.babylonjs.com/babylon.js:16:582206)
[EDIT2] Also Rabbit.babylon doesn’t work too and others. I’m really confused about this !
[EDIT3] It seems that the problem is only when the filename starts with an upper case letter.. Everything seems to work correctly with .babylon and .glb files. Feeling so stupid now.
Uhm is your syntax correct ? Cause I tried it and I get errors.
Your input is invaluable nonetheless !
[EDIT] I know it’s a bit hacky but I just turn all letters to lowercase upon load for now :
`loadButton.onchange = function(evt){
var files = evt.target.files;
var filename = files[0].name;
var filenameLowercase = filename.toLowerCase();
var blob = new Blob([files[0]]);
BABYLON.FilesInput.FilesToLoad[filenameLowercase] = blob;
assetsManager.addMeshTask("task1", "", "file:", filenameLowercase);
assetsManager.load();};`
[EDIT 2 ] I’m thinking that it’s because keys aren’t supposed to be uppercase at all.