Jump to content

Loading file (scene) from file picker


focomoso
 Share

Recommended Posts

I'm looking for a way to run the assetsManager (with all of its nifty file type checking) on a file chosen by the user via the file picker (or drag and drop). Is there a simple way to do this? The assetsManager seems only to take a url and filename. Is there a way to send it a file blob?

If not, does anyone have any ideas on a relatively simple way to do this?

Thanks

Link to comment
Share on other sites

I'm able to load files using the specific plugin for the extension with:

      BABYLON.SceneLoader.GetPluginForExtension('.stl').load(this.scene,e.target.result,"root");

e.target.result is the file that comes from the file picker. This works fine, but...

  • I have to do the file checking by hand (not ideal)
  • I don't get a ref to the mesh like I do when I use the assetsManager which makes it hard to manipulate it after upload
     

Any thoughts?

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...