Skip to content

Drag and drop models from a library #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vincentfretin opened this issue Dec 19, 2024 · 3 comments
Open

Drag and drop models from a library #11

vincentfretin opened this issue Dec 19, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@vincentfretin
Copy link
Member

Allow to define a library of models in the editor to be used in any open projects.
There is an old draft PR in #1 but I did a better one in a customer project.

@vincentfretin vincentfretin self-assigned this Dec 19, 2024
@vincentfretin vincentfretin added the enhancement New feature or request label Dec 19, 2024
@jywarren
Copy link

This is interesting! Would these be only models which are already hosted somewhere online, or might this include ones dragged from a user's desktop? That sounds a little complex i.e. where to store the .glb - I've seen data-uri encoded files but it makes the .html quite unmanageably gigantic. Is there any way to use the File System API or something to store dragged-in assets and then offer a .zip of everything as an export? Sorry this scope is a bit bigger maybe than you're imagining...

@vincentfretin
Copy link
Member Author

What I currently have implemented in a project is just a json file for the library referencing files on a server, so you can create gltf-model component that references that url on a server, and the scene json is saved on the server.
Here I was only talking about drag and drop from a UI panel that reads that library json file to show the available models, so not drag and drop from user desktop at all, but that's something indeed to consider, thanks for mentioning it.
You can indeed drag and drop and just use a data uri on gtlf-model, that's what we do in gltf-model-plus repo playground example for development, but as you said exporting then the html with data uri for the models would be huge.
The File System API is something I want to explore in #9, we could potentially create the drag and dropped glb on the file system instead of using a data uri.
Creating a zip of the experience with all relative assets could also be great indeed if the scene and assets are saved directly on a server. If the scene html and assets are already on your machine, you can just use the archive feature on a directory of your OS for that.

@jywarren
Copy link

jywarren commented Mar 12, 2025 via email

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

No branches or pull requests

2 participants