Hello!
I need a one file html file for a customer to use the BABLYON 3D Viewer for glb files. Must run offline as well. (Just one File, not multiple files in the same folder, and no Webserver) The Customer must receive the File, open it and sees the 3D Object. (there are some custome HTML GUI, Infotexts etc. so a Windows 3D Viewer doenst help) (He want to show it at events whithout internetConnection on the computer)
I already accomplished to base64 convert the GLB FIles, Javascripts, Images, Environment dds, etc.
The only problem is now the Draco Decoder URLS:
var draco = `var DracoDecoderModule=function(){var r=“undefined”!=ty… // whoe js file minified copied here
let dracoUrl = “data:application/octet-stream;base64,” + btoa(draco);
let dlob =await fetch(dracoUrl,)
.then(resD => resD.blob())
.then(blobD => {
let dUrl = URL.createObjectURL(blobD);
BABYLON.DracoCompression.Configuration.decoder.wasmUrl = dUrl;
console.log('drace set: ',BABYLON.DracoCompression.Configuration.decoder.wasmUrl ); // → seems alrigt blob:null/e7…
(tried all 3 decoders: wasmBinaryUrl, fallbackUrl, wasmUrl)
I can load the File with: BABYLON.Tools.LoadFile(dUrl, (data → and get teh Data from the string.
But if I try to load a model Ill get a
Not allowed to load local resource: blob:null/e7bc538a-9971-4830-b4ec-fc9751f5fee8
Uncaught DOMException: Failed to execute ‘importScripts’ on ‘WorkerGlobalScope’: The script at ‘blob:null/e7bc538a-9971-4830-b4ec-fc9751f5fee8’ failed to load.
at onmessage (blob:null/bf090157-7588-428d-a5ed-9f645c60c84e:1:1529)
the URL is file://C:/…index.html Implementing the GLB File and DDS File was done the same way without errors. So I wonder if there is some kind of bug. I havent understoot how the draco thing is working:
I tried to turn off Browser Security, Start browser with a
chrome.exe --allow-file-access-from-files.
but nothing helped.