3D for mortals

how save mesh uses press html button?

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()

Share this post

Link to post
Share on other sites
20 minutes ago, NasimiAsl said:

a.onclick() or $(a).click()

omg))) ... button way!... pure button way, because i want that sources will be taken only in time of creating exported file data. In case of use a.onclick , "a" must be prepaired before using, and take cpu and memory every time i recount model.

Share this post

Link to post
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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.