Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exportGLTF() {
const scene = this.props.scene;
this._isExporting = true;
this.forceUpdate();
GLTF2Export.GLBAsync(scene, "scene", {
shouldExportNode: (node) => this.shouldExport(node)
}).then((glb: GLTFData) => {
glb.downloadFiles();
this._isExporting = false;
this.forceUpdate();
}).catch(reason => {
this._isExporting = false;
this.forceUpdate();
});
}
button.addEventListener('click', () => {
GLTF2Export.GLBAsync(this._inspector.scene, name.value || "scene", {
shouldExportTransformNode: transformNode => !GLTFTab._IsSkyBox(transformNode)
}).then((glb) => {
glb.downloadFiles();
});
});
}