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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.