Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Downloading objects/scenes #49

Open
jespertheend opened this issue May 18, 2020 · 1 comment
Open

Downloading objects/scenes #49

jespertheend opened this issue May 18, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@jespertheend
Copy link

An option for downloading objects or scenes for further inspection in the editor would be nice.

I'm currently using this snippet in the inspector that I run every time I want to download the scene.

let main = window.g_main || window.main;
let scene = main.game.scene;
scene.traverse(obj => obj.updateMatrix());
let str = JSON.stringify(scene.toJSON());
let aEl = document.createElement('a');
aEl.setAttribute("href", window.URL.createObjectURL(new Blob([str], {type: 'text/plain'})));
aEl.setAttribute("download", "scene.json");
aEl.click();

But it depends on g_main.game.scene existing. It would be nice to have a more general solution.

@jsantell jsantell added the enhancement New feature or request label Jun 30, 2020
@jsantell
Copy link
Member

This would be a nice improvement to serializable objects (scenes as JSON, objects as GLTF)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants