STL file browser

Ok! I think this makes a lot of sense now. Thank for clarifying even more!

Here is what I found out: It is possible to load an STL from a local directory but it’s a little more tricky then just “drop file” into scene loader or asset manager.

In summary answer from the awesome @RaananW : “It is possible to load the model as a base664 data url or create a blob of the file in any way you like”

AHA! And what do you know I started digging around the forums and came across this thread and playground :wink:

Really weird thing about this demo though. Was I had to go into the debug view to find the file button that was added to the document at the very bottom. Not sure why it’s hidden normally, maybe css?

image

Anyways the important part I think you’ll want to check out is lines 49-65

        var files = evt.target.files;
        var filename = files[0].name;
        var blob = new Blob([files[0]]);

        BABYLON.FilesInput.FilesToLoad[filename] = blob;
        
        assetsManager.addMeshTask(name, "", "file:", filename);
        assetsManager.load();

Hope this helps and let me know if you have any questions!