Hubs-Foundation / hubs-blender-exporter

The Hubs Blender Add-on enables artists to export their creations to the immersive web with Hubs
Mozilla Public License 2.0
165 stars 51 forks source link

Add support for assets uploading #271

Open keianhzo opened 3 months ago

keianhzo commented 3 months ago

Is your feature request related to a problem? Please describe. After adding support for scene uploading there is still a feature missing for full parity with Spoke: Assets uploading. In spoke you can drag and drop and asset to the "My assets" panel that will be uploaded to your instance. Once uploaded you can:

Describe the solution you'd like We can have a similar panel to the scenes one where we can list all the assets in your instance, upload or delete assets. Not sure if we can add viewport drag & drop support and create an empty+component for that media but at least we should allow to easily copy the asset URL so the user can paste it in the component URL field. Blender supports copying a property if you do a Ctrl/Cmd+C while hovering it. We should check if that's intuitive enough or it's wort adding a specific button or a right click modal to make it more obvious.

Additional context We already have a function to upload media to the Hubs instance that we use for scene GLBs upload: https://github.com/MozillaReality/hubs-blender-exporter/blob/28cb74178066f2da50b20bebfc6637a3afea7c7c/addons/io_hubs_addon/api.py#L30 We can probably repurpose that one for generic media uploading. That is based on this Spoke code: https://github.com/mozilla/Spoke/blob/9fe7af7e0b4eab5908d1ada17c06aab223c978ce/src/api/Api.js#L372 There is also an endpoint for assets deletion, we should implement an equivalent function for that one in Blender: https://github.com/mozilla/Spoke/blob/9fe7af7e0b4eab5908d1ada17c06aab223c978ce/src/api/Api.js#L1189