Jump to content

how save mesh uses press html button?


3D for mortals
 Share

Recommended Posts

for example i have:

html button

<button id="objButton" onclick="fileExport()"></button>

result of

var objtext = BABYLON.OBJExport.OBJ(OBJexport); // this is *.obj file syntax with meshes from scene

what syntax

should i use inside fileExport function, that popup window savefile in browser?

I have syntax with link a href which work , but i need use button, because the program gui with buttons usually, but not with text links.

this is a href syntax:

function download(text, name, type) {

    var a = document.getElementById("a");

    var file = new Blob([text], {type: type});

    a.href = URL.createObjectURL(file);

    a.download = name;

}

after this, click link and can save file. I need button way. If possible not way where button press call a.click()

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...