c-frame / aframe-gltf-model-plus

gltf-model-plus component to load glb file with hubs extensions
https://c-frame.github.io/aframe-gltf-model-plus/
Mozilla Public License 2.0
10 stars 3 forks source link

Write documentation how to export your hubs scene and run it #18

Open vincentfretin opened 2 months ago

vincentfretin commented 2 months ago

Write documentation how to export your hubs scene from Spoke and downloading the linked assets (and later using the export feature that the Hubs team is working on), upload assets to glitch assets or a public github repo and using jsdelivr cdn (reading the terms, it allows to deliver glb files for free but it may have restrictions on size) but you don't even need jsdelivr cdn, you can just enable GitHub Pages on your public repo.

vincentfretin commented 2 months ago

The only export I did was from a remix of the outdoor festival scene I pushed in https://github.com/c-frame/outdoor-festival, using File->Export as binary glTF in Spoke. It worked fine for this scene. I don't have any other scene in hubs personally. Then I retrieved the urls for the different linked assets like mp3 and other glb with console.log of the hubs gtlf extensions from my importer to not miss any link and I downloaded them all.

In case you have an error exporting from Spoke, if your scene was previously published successfully, you can get the glb url by accessing a room that uses this scene, inspect the page with Chrome, in Console search for "Scene" you will have a log with Scene URL and the url with a .bin extension, download it, rename it to glb and quickly verify it on https://gltf-viewer.donmccurdy.com/ to see if the file is correct.

If you added some objects in a room and pinned them, then those are in a separate gltf file, you can download the file from https://hubs.mozilla.com/xxxxxxx/objects.gltf where xxxxxxx is your room id.

jywarren commented 2 months ago

Just reporting that I downloaded the repo today, swapped in my .bin download of a big (70mb) scene, renamed it to scene.glb, and inserted it to replace this line:

https://github.com/c-frame/aframe-gltf-model-plus/blob/da35b7451d8cf0e7173380ff5a9a2f7f40a5fe8d/examples/playground/index.html#L129

And added an ambient light on line 144 (my scene lights didn't get enabled?):

<a-entity light="type: ambient; intensity: 0.2"></a-entity>

https://github.com/c-frame/aframe-gltf-model-plus/blob/da35b7451d8cf0e7173380ff5a9a2f7f40a5fe8d/examples/playground/index.html#L144C23-L144C24

and ran http-server (an NPM module i use) to start the server. It worked immediately, with ability to navigate with Hubs commands AWSD!

Image

Just offering thanks, this is so cool!

vincentfretin commented 2 months ago

That's great! I indeed don't support the lights from hubs component currently, I will implement them in #30 The repo has actually a server, you can also run it with: npm install npm start I'll add that to the README.

jywarren commented 2 months ago

I'd love next to try to get the objects.gltf running but this'll await #13 as my objects are all images. Will check back in when I do, and happy to write some simple docs on this.

vincentfretin commented 2 months ago

I quickly wrote this doc https://github.com/c-frame/aframe-gltf-model-plus/commit/f3265af7f3877233e95e7ef4d3233933008b7c85 in the README. If it's not clear enough or you have something to add, don't hesitate to create a PR.

vincentfretin commented 1 month ago

https://hubs.mozilla.com/labs/downloading-your-data/ https://hubs.mozilla.com/docs/download-data.html

vincentfretin commented 1 month ago

https://www.youtube.com/watch?v=vnkgGLkcxuk