User must be logged into Clara.io site to download

This commit is contained in:
David Rowe 2017-01-12 09:15:01 +13:00
parent 71d6a5cb1d
commit 9bdcdf73c1

View file

@ -132,6 +132,8 @@
// Automatic download to High Fidelity.
function startAutoDownload() {
// User must be able to write to Asset Server.
if (!canWriteAssets) {
console.log("ERROR: Clara.io FBX: File download cancelled because no permissions to write to Asset Server");
EventBridge.emitWebEvent(WARN_USER_NO_PERMISSIONS);
@ -139,6 +141,13 @@
return;
}
// User must be logged in.
var loginButton = $("#topnav a[href='/signup']");
if (loginButton.length > 0) {
loginButton[0].click();
return;
}
// Obtain zip file to download for requested asset.
// Reference: https://clara.io/learn/sdk/api/export
var XMLHTTPREQUEST_URL = "https://clara.io/api/scenes/{uuid}/export/fbx?zip=true&centerScene=true&alignSceneGound=true&fbxUnit=Meter&fbxVersion=7&fbxEmbedTextures=true&imageFormat=WebGL";