• Stars
    star
    165
  • Rank 227,612 (Top 5 %)
  • Language
    Python
  • License
    Mozilla Public Li...
  • Created about 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Hubs Blender Add-on enables artists to export their creations to the immersive web with Mozilla Hubs

Hubs Blender Exporter and Importer

This addon extends the glTF 2.0 exporter to support the MOZ_hubs_components and MOZ_lightmap extensions allowing you to add behavior to glTF assets for Mozilla Hubs.

Test Publish

To Install

Find the latest release and download the add-on zip file.

select add-on zip file

In Blender: Edit > Preferences > Add-ons Click install and select the zip file of the latest release.

in blender prefs install addon

Ensure the Hubs add-on is checked and enabled.

hubs blender add-on installed

Adding Components

To add components, go to the "Hubs" section of the properties panel for the thing you want to add a component to. Currently adding components is supported on Scenes, Objects, Bones, and Materials.

Click "Add Component" and select the component you wish to add from the list. Only components appropriate for the object type you are currently editing and have not already been added will be shown.

Using Lightmaps

To use a lightmap, create a MOZ_lightmap node from the Add > Hubs menu and hook up a image texture to the Lightmap input. Use a UV Map node to control what UV set should be used for the lightmap, as you would any other texture in Blender.

lightmap node

Note that for use in Hubs, you currently MUST use the second UV set, as ThreeJS is currently hardcoded to use that for lightmaps. This will likely be fixed in the future so the add-on does not enforce this.

setting bake UV

Exporting

This addon works in conjunction with the official glTF add-on, so exporting is done through it. Select "File > Export > glTF 2.0" and then ensure "Hubs Components" is enabled under "Extensions".

gltf export window

Import into Hubs

The easiest way to use your scene file is through the Spoke project creation page and selecting Import From Blender:

Screenshot 2021-10-31 at 14 05 21

This will bring up the Publish Scene From Blender dialog where you can upload your GLB file and a thumbnail picture for your scene:

Screenshot 2021-10-31 at 14 31 44

It is also possible to use the GLB file to replace the scene for an existing Hubs room directly by going to Room Settings > Change Scene > Custom Scene and entering the URL of the GLB file. This assumes the file has been already uploaded to an online storage provider.

Development

Code Completion

To enable code completion for the Blender Python API you can install the Fake Blender Python API module collection. You can download the modules using the setup.sh script from the repository root or using pip.

Code style

Tis repository follows the PEP8 style convention for python files. If you use VSCode this repository already includes a setting to autoformat every python file when saved. If you don't use VSCode you can probably add a similar setting in your favorite editor. We are happy to add settings for other editors so feel free to open a PR if you want you editor's settings included.

We also includes a format.py python script that will formats the whole codebase when run. You can run it before pushing the PR to make sure that all the new code follows PEP8.

Both the python script and the VSCode settings rely on the autopep8 command line tool for formatting so make sure that it's installed in your system.

Addon development

It might be useful while developing to be able to load the addon directly from the checkout folder without needing to install it. You can do it in two ways:

  • Overriding the Blender user scripts directory

    You can override the Blender user scripts directory from the console to point to the addon repo directory.

MacOS

BLENDER_USER_SCRIPTS=full_path_to_/hubs-blender-exporter /Applications/Blender.app/Contents/MacOS/Blender

Linux

BLENDER_USER_SCRIPTS=full_path_to_/hubs-blender-exporter blender

  • Symlinking your addon to the Blender user scripts directory

    You can create a symbolic link pointing to full_path_to_/hubs-blender-exporter/addons/io_hubs_addon in your current Python scripts directory in Blender. This way you will also load any other addons that you have in that directory.

MacOS and Linux

ln -s full_path_to/hubs-blender-exporter/addons/io_hubs_addon full_path_to/blender_user_scrips_dir

You can set or see the current Blender user scripts in the Preferences -> File Paths -> Scripts

Debugging

You can debug the addon code with PyCharm or VSCode:

Continuous Integration Tests

To run the tests locally, your system should have a blender executable in the path that launches the desired version of Blender.

The latest version of Yarn should also be installed.

Then, in the tests folder of this repository, run yarn install, followed by yarn run test.

More Repositories

1

FirefoxReality

INACTIVE - A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
Java
769
star
2

unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
JavaScript
622
star
3

WebXR-emulator-extension

INACTIVE - WebXR emulator extension
JavaScript
459
star
4

servo-unity

INACTIVE - Servo for Unity - experimental
C
317
star
5

hello-webxr

INACTIVE - Hello WebXR
JavaScript
288
star
6

vr-web-examples

Example VR enabled web pages.
JavaScript
205
star
7

webvr-spec

*** MOVED TO https://github.com/w3c/webvr ***
HTML
158
star
8

sechelt

INACTIVE - A virtual reality fly through of a 3D landscape, built with Three.js and Cinema 4D.
JavaScript
151
star
9

immersive-custom-elements

INACTIVE - Immersive Custom Elements
JavaScript
134
star
10

hubs-avatar-pipelines

Mozilla Hubs avatars and related assets for avatar customization.
95
star
11

panorama-viewer

A Three.js panorama viewer
JavaScript
93
star
12

webxr-ios-js

INACTIVE - A JS implementation of WebXR used *only* in Mozilla's WebXR Viewer
JavaScript
71
star
13

webvr-demos

Archived WebVR demos from Mozilla WebVR, circa GDC 2016.
JavaScript
63
star
14

blender-gltf-multiexport-addon

INACTIVE - Blender add-on to export multiple glTFs at once
Python
56
star
15

hubs-discord-bot

A Discord bot that helps you use Mozilla Hubs together with people in Discord.
JavaScript
47
star
16

hiro

JavaScript
42
star
17

jumpy-balls

INACTIVE - Example game with ecsy, three.js and ammo.js physics
JavaScript
34
star
18

webxr-geospatial

INACTIVE - A library that combines the Web geolocation API with WebXR to support geospatial AR
JavaScript
34
star
19

gamepad-plus

INACTIVE - a superb library that extends the Gamepad API with super powers
JavaScript
34
star
20

puzzle-rain

INACTIVE - A musical WebVR journey for the HTC Vive. Brought to you by Mozilla VR.
JavaScript
33
star
21

mred

INACTIVE - Mixed Reality Editor
JavaScript
27
star
22

xr-store

INACTIVE - A progressive XR demo. Powered by A-Frame.
JavaScript
23
star
23

FirefoxRealityPC

INACTIVE - Firefox Reality for PC-connected VR platforms
C#
22
star
24

hubs-docs

JavaScript
21
star
25

blender-gltf-behavior-graph

Tool for editing GLTF Behavior graphs in Blender (extremely experimental, opinionated for usage in Mozilla Hubs)
Python
20
star
26

webvr-addon

Mozilla WebVR Plus browser extension for Firefox
JavaScript
19
star
27

foxr-run

INACTIVE - Run Foxr, Run!
JavaScript
19
star
28

webgfx-tests

INACTIVE - Performance tests for canvas and webgl
JavaScript
19
star
29

MOZ_text

INACTIVE - MOZ_text glTF Extension
JavaScript
18
star
30

three-batch-manager

TypeScript
17
star
31

hubs-plugin-api

INACTIVE - Experimental Hubs plugin API discussion and evaluation
JavaScript
16
star
32

hubs-architecture-kit

JavaScript
14
star
33

vrb

INACTIVE - Support render library for FirefoxReality
C++
13
star
34

gltf-navmesh-generator

Small library and command line utility for generating precomputed navmesh data for aframe-extra's nav-mesh
JavaScript
12
star
35

botomatic

INACTIVE - Hubs Bot lambda
JavaScript
10
star
36

photomnemonic

Simple AWS Lambda service for grabbing web screenshots
JavaScript
10
star
37

lib-hubs

Common Hubs and Spoke libraries.
JavaScript
9
star
38

OpenWnn

INACTIVE - OpenWnn fork
C
9
star
39

gltf-bundle

INACTIVE
JavaScript
9
star
40

vr-mozilla-org

INACTIVE - Source for Mozilla Mixed Reality static site
CSS
9
star
41

hubs-glb-tools

Tools for working with glb files for Mozilla Hubs [WIP]
TypeScript
8
star
42

gltf-unlit-generator

INACTIVE
Rust
6
star
43

mr-social-assets

INACTIVE - Open Source Assets from the Social Mixed Reality Team
Mathematica
6
star
44

blender-behavior-graph-examples

A collection of Blender files demonstrating behavior graphs
6
star
45

webvr-libs

WebVR libraries
JavaScript
6
star
46

nearspark

AWS lambda service for creating image thumbnails
JavaScript
5
star
47

Hubs-Backup-Tool

A tool for baking up your Hubs instance account data
TypeScript
5
star
48

avatar-texture-tool

A resource for creating avatar textures for Hubs avatars
JavaScript
5
star
49

ecsy-webpack-boilerplate

INACTIVE - A simple boilerplate project for getting up and running with ECSY and Webpack.
JavaScript
5
star
50

fxr-cli

INACTIVE - A command-line tool for installing and automating the Firefox Reality virtual-reality browser.
JavaScript
4
star
51

gltf-content-hash

INACTIVE
JavaScript
4
star
52

hubs-duck-addon

TypeScript
4
star
53

symbolgenerator

INACTIVE - The symbol generator for Firefox Reality native code
Python
4
star
54

hubs-configtool

Tool for reading and writing Hubs configuration values.
JavaScript
3
star
55

spoke-react-components

https://mixedreality.mozilla.org/spoke-react-components
JavaScript
3
star
56

pathfinder_cpp

INACTIVE - c++11 implementation of PathFinder
C
3
star
57

hubs-template-addon

A template project for creating Hubs add-ons
TypeScript
3
star
58

hubs-sound-pack

JavaScript
3
star
59

hubs-ts-types

Typescript definitions for Hubs
TypeScript
3
star
60

hubs-portals-addon

A hubs add-on that adds support for portals.
TypeScript
3
star
61

oculus

JavaScript
2
star
62

webxr-todo

INACTIVE - List of ideas to improve the WebXR ecosystem
2
star
63

webxr-agent

Helper for handling presentation, navigation, and telemetry for WebXR experiences.
JavaScript
2
star
64

lobby

INACTIVE - WebVR Lobby
JavaScript
2
star
65

FirefoxReality-gvr-android-sdk

INACTIVE - GVR headers and library dependancies for Daydream build of Firefox Reality
C++
1
star
66

hubs-iframe-test

INACTIVE - GitHub Pages hosted page for testing Hubs in iframes
HTML
1
star
67

fbx-gltf-pipeline

INACTIVE
JavaScript
1
star
68

ita

A service for doing Hubs configuration management.
JavaScript
1
star
69

hubs-behavior-graphs-addon

A behavior graphs addon for Hbs
TypeScript
1
star
70

create-hubs-app

INACTIVE
JavaScript
1
star
71

badge-maker

INACTIVE
JavaScript
1
star
72

gltf-component-data

INACTIVE - Small library and command line utility for adding component data to a glTF file.
JavaScript
1
star
73

ecsy-three-webpack

INACTIVE - Boilerplate project for ecsy-three and Webpack
JavaScript
1
star
74

gltf-collision-exporter

INACTIVE
1
star
75

horizon

(2015) Horizon was an experimental VR browser built on web standards using CSS-VR.
JavaScript
1
star
76

area-demo-service-task

INACTIVE - Integration of OpenSceneGraph-based rendering with WebXR in a demonstration service task for AR Enterprise Alliance
JavaScript
1
star