Changed to use downloadFile function

This commit is contained in:
Evolvedexperiment 2021-03-24 18:30:27 +00:00
parent 6861de92a0
commit 9c5805889b

View file

@ -128,13 +128,7 @@ const saveScreenshot = async function() {
} }
const saveOBJ = async function() { const saveOBJ = async function() {
const URL = 'data:text/plain;charset=UTF-8,' + encodeURIComponent(await getOBJ()); downloadFile(await getOBJ(), getFileName() + ".obj", "text/plain;charset=UTF-8");
const link = document.createElement("a");
link.download = getFileName() + ".obj";
link.href = URL;
link.click();
tip(`OBJ is saved. Open "Downloads" screen (CTRL + J) to check`, true, "success", 7000);
window.setTimeout(() => window.URL.revokeObjectURL(URL), 5000);
} }
// start 3d view and heightmap edit preview // start 3d view and heightmap edit preview