iTranslated by AI
Steps to Use Your Own Custom Avatars in Mozilla Hubs
TL;DR
- Hubs, a VR platform developed by Mozilla, has a feature that allows GLB files to be used as custom avatars.
- However, the avatar specifications for Hubs differ significantly from those of VRChat or cluster. Therefore, simply converting the file format of your existing avatar will not make it work correctly.
- In this article, I will introduce the steps to modify your existing avatar model to meet Hubs specifications using the 3D modeling software Blender.
For those who just want a cute avatar to use in Hubs right away, I am releasing the GLB file of an avatar I modified for Hubs.
This avatar is based on the model "Girl A" by Kutsushita, which is under a CC0 license (Public Domain).
I have confirmed its operation myself, but please use it in Hubs at your own risk.
Introduction
What is Hubs?
Mozilla Hubs (hereinafter referred to as Hubs) is a social VR platform by Mozilla, the developer of the Firefox browser.
In other words, you can move around as an avatar in a 3D virtual world and converse with other participants.
It offers the following advantages compared to VRChat or cluster, which are well-known in Japan:
- It works easily within a web browser alone, requiring no dedicated client or account.
- There is no preparation work that often acts as a barrier when getting people to use a VR platform; you can join with just a few clicks if you have a modern browser.
- Easy placement of files and URLs.
- You can bring in various files such as images, videos, and URLs simply by dragging and dropping them into the browser.
For basic usage of Hubs, please refer to the following materials and articles.
- How to use Mozilla Hubs taught by the UTokyo VR Center: Making remote work easy and interesting with social VR meetings
- Trying out Mozilla Hubs for now
Hubs is increasingly being adopted for academic conferences and art events where online holding has become the norm due to the impact of COVID-19.
At the 25th Annual Conference of the Virtual Reality Society of Japan, held from September 16 to 18, 2020, a poster session using Hubs was attempted as an Open Virtual Exhibition (OVE).
Avatar Situation in Hubs and Custom Avatars
In Hubs, you can wear a wide variety of avatars as standard (from the top-left menu button, go to "Set name & Avatar" -> "Browse Avatars").
However, most of them are either simple cylindrical robots or human-type avatars with a Western appearance.
Since many people in Japan habitually use their preferred avatars in VRChat or cluster, they would likely be happy if they could use those same avatars in Hubs as well.
In fact, at the aforementioned VRSJ conference, there were several participants, including myself, who brought in avatars they had modeled or modified themselves.
However, custom avatars for Hubs have different specifications from other platforms, and it is not as simple as just uploading a file and having it work.
I tried the method in "Importing VRoid avatars into Hubs" published on Qiita, but I encountered issues such as the avatar not rotating with the head, arms not moving, and the avatar's appearance breaking in first-person view.
After much trial and error, I succeeded in bringing one in by "using Blender to port the model I wanted into the bones of a Hubs-specific avatar."
In this article, I will organize and introduce the steps I took to succeed.
For those who cannot or do not want to do complex work in Blender
There are several ways to easily create customized avatars in Mozilla Hubs.
If you are not particular about using your own specific avatar, consider using the following services:
-
Quilt
- A web app provided by the Hubs official team where you can apply your favorite textures to robot avatars.
-
ReadyPlayerMe
- A web app that analyzes an uploaded photo of your face to create an avatar with a similar look.
-
VOXELCANVAS
- A 3D dot-art creation service published by Mr. Utaro (@utautattaro).
- During the VRSJ conference (!), a feature to export GLB files was added, making it possible to bring models into Hubs.
Also, as mentioned at the beginning, I am distributing the GLB file of the CC0 avatar "Girl A" modified for Hubs below:
Environment
- Software
- Blender 2.83
- Mozilla Hubs (It is recommended to create an account via email authentication)
- Hardware
- Head-mounted display (if available)
- Having VR equipment allows you to confirm that the avatar's hands move within Hubs.
- Head-mounted display (if available)
- Author's Technical Level
- VR experience: About 3 years
- Modeling/Blender: Amateur
- I almost touched Blender a few years ago but gave up after being confused by right-click selection and the strange monkey.
- Those skilled in modeling might have other methods besides reusing existing data.
Hubs Avatar Basics
First, let's understand the specifications of Hubs avatars. The official Hubs documentation provides an explanation of specifications for creating custom avatars.
Here is a list of information gathered from the documentation:
- Blender 2.83 is recommended.
- The height of a standard avatar is 1.7m, including the legs which are not present in robot avatars.
- There is no inverse kinematics (IK), meaning arm and leg joints cannot be represented.
- There are no lower body or arm bones.
(The image on the right is quoted from Advanced Avatar Customization · Hubs by Mozilla)
In particular, the height and position of the avatar are important pieces of information for creating a correctly sized avatar.
When you open the .blend file of the robot avatar distributed as a sample, the origin is located exactly at what would be the waist.
Although not explicitly stated officially, looking at various cases, it seems necessary to move the origin to the waist area even for non-robot avatars.
Otherwise, the area below the origin will be treated as invisible legs, causing the avatar to float in the air.
Furthermore, due to the lack of IK, Hubs avatars only have bones for the head, torso, right hand, and left hand.
Even if other parts exist in the model, they likely won't move.
This is likely why simply bringing in an avatar model usable in VRChat and similar platforms does not work.
Overview of the Avatar Modification Process
Considering the specific circumstances of Hubs avatars, we will proceed with the modification using the following approach:
- Reuse the bones of an existing Hubs-specific avatar.
- Since the arm parts of the imported avatar cannot be moved anyway, we will remove them.
- Since both hands have detailed bones and animations, we will use those from the Hubs avatar as-is.
From here on, for the sake of distinction, the base Hubs avatar will be called "Avatar A" and the imported avatar will be called "Avatar B". The following diagram shows the outline of the work.
Please note that basic Blender operations may be omitted from the explanation. However, most of the work is done in the Layout workspace, so you don't need to fully understand all of Blender's functions. Please read along while searching if necessary.
Creating Avatar A for Hubs
Avatar models already configured for Hubs include the official robot avatar (AvatarBot_base_for_export.blend) and models from ReadyPlayerMe. In this guide, we will use the latter as the base for modification. This is because we want to use the avatar's hands as-is, and the realistic hands of ReadyPlayerMe (left) are more convenient than the robot hands (right).
Access ReadyPlayerMe and create a new avatar via "Create Avatar." You can choose the gender from male, female, or neutral, but since the hand shape doesn't seem to change between them, choose whichever you like. Next, take or upload a face photo. Since we only need the bones and the hand mesh, it can be your face or someone else's.
You can customize the skin and clothing colors on this screen as well. You can change them later in Blender, so edit them to your liking. Once the avatar is ready, click the Done button in the upper right, and a URL to the GLB file will be displayed. Open this in your browser to download the GLB file.
Launch Blender and import the GLB file via the menu bar "File -> Import -> glTF 2.0". First, we won't be using the torso (head) mesh, so select and delete it. In the case of ReadyPlayerMe, the eyeballs and teeth are also separate meshes, so delete them all together.
Now the preparation for the base Avatar A is complete.
Loading and Editing Avatar B to Import
Now, let's load Avatar B, the one you actually want to use. You can choose any avatar, but one with a less complex shape is less likely to fail and more advantageous for making it lightweight for Hubs.
Here, we will use the VRM file of the free avatar "Girl A" obtained from VRoid Hub.
If you want to import VRM into Blender, you need to install the VRM_IMPORTER add-on.
Once loaded, delete Avatar B's bones as they will not be used.
Next, adjust the position and size of Avatar B. As mentioned in "Hubs Avatar Basics," this step is crucial because if the origin is not around the waist, the height in Hubs will be incorrect.
Select the model parts and adjust them using the shortcut for Z-axis movement (G → Z) and the shortcut for resizing (S).
You can check the dimensions from "Item → Transform" on the right side of the viewport; it is ideal to set the height from head to toe to about 1.7m.
You can still change the position and size later (as long as you move them with the bones). If it feels off after uploading to Hubs, return to Blender and repeat the fine-tuning.
Finally, trim the mesh from the arms down on Avatar B.
Since Hubs does not support arm bones, leaving them in would mean they remain fixed in a T-pose and cannot be moved.
Since we are using the hands from Avatar A, it is better to remove them from Avatar B.
Select the mesh, enter Edit Mode, select the vertices, and delete them (key X).
When selecting, it is easier to see and select vertices on the back side by using the Wireframe display mode (key Z).
For the holes at the shoulders, select the surrounding edges and use Alt + F to fill them.
Parenting Avatar A's Bones and Avatar B's Model
Now that we have all the elements necessary for modification, it's finally time to parent (set parenting) the Hubs-specific bones to the avatar model so they move together.
Before that, if the bone placement doesn't match the model, correct it in Edit Mode.
The bones in the torso section are Hips / Spine / Neck / Head from bottom to top. Since the Neck part moves according to the viewpoint, make sure to position the Neck bone near the neck area.
Also, move the RightEye / LeftEye bones to be near the eyes so that the viewpoint in Hubs aligns with the avatar's eyes.
Once finished, return to Object Mode, select the mesh then the bones, and press Ctrl + P -> "With Automatic Weights" to set the parent-child relationship.
A warning "Bone Heat Weighting: failed to find solution for one or more bones" may appear, but as long as weights are set in the successful parts, you can proceed.
To check if the weights (how much each vertex follows a bone) were set correctly, select the mesh and press Ctrl + Tab to open Weight Paint Mode.
To ensure the head mesh follows properly when moving the head in Hubs, assign the head mesh to Head (and LeftEye/RightEye), and the torso mesh to Spine and Hips.
By switching to Pose Mode and selecting a bone, you can actually move the neck to test it. Check for any strange movements while switching between modes.
Additionally, there was a discussion in an issue on Mozilla's GitHub repository about how vertices associated with both the head and torso can cause mesh glitches in first-person perspective.
To prevent this, it's best to strictly separate them: assign the head mesh only to Head (and LeftEye/RightEye), and the torso mesh only to Spine and Hips.
Furthermore, I set the weight for all vertices to 0 for the middle Neck bone (select the Neck vertex group in Edit Mode and click the "Remove" button).
If you set up LeftEye and RightEye well, the eyes will move with animations. If it's too much trouble, you can just set their weights to 0.
Changing Avatar Material Settings
At this point, the movements are almost ready, but even if you export the GLB file now, the avatar might appear completely white without textures in Hubs depending on the model.
I suspect this is because Hubs cannot display the MToon_unversioned shader used in VRoid VRM files.
Therefore, the solution is to replace it with a shader that Hubs can display. Here, we will change it to "Principled BSDF," which is the Blender default.
Select the mesh, open the Material Properties in the Properties window, and change the settings as follows:
- Surface: Principled BSDF
- Base Color: Image Texture
- Select the corresponding texture image from the dropdown.
- Texture images should be saved in a folder like "tex_(VRM title)" within the same folder where you opened the avatar's VRM file.
If the model looks too shiny like plastic, you might want to lower the "Specular" value to your liking.
Also, if you feel the hands or sleeves from the ReadyPlayerMe avatar don't match Avatar B's style, replace the materials for the hands as well.
I did this by selecting the faces for the hands and sleeves in Edit Mode and assigning a newly created single-color material to them. There are likely other ways to achieve this.
Exporting the GLB File
It's finally time to export.
Open the export dialog via Menu Bar -> File -> Export -> glTF 2.0.
In the settings on the right, make sure the "Format" is glTF Binary (.glb).
Also, to ensure hand animations display correctly, uncheck "Animation -> Animation -> Always Sample Animations" (thanks to the great custom avatar pioneer Toya-kun @skg_ty for this tip!).
Go to Hubs, open the avatar creation screen via top-left menu button -> "Set name & Avatar" -> "Browse Avatars" -> "+ Create Avatar".
Select the GLB file you created via the "Custom GLB" button to preview your avatar.
First, check the movement in desktop mode.
Enter the same room using two different browsers (e.g., Chrome and Firefox). Use one to look around and operate while using the other to observe if the scale and height are normal and if any parts of the mesh are collapsing.
Unless you are very experienced in avatar creation, you will likely find something wrong.
In particular, you'll need to go through a cycle of trial and error for weight and texture settings—checking the look in Hubs, then going back to Blender to fix and re-upload.
For those using HMDs, next check how the hands look in VR mode.
If animations are correctly specified, your fingers should move with controller operations.
These movements are visible to those you talk to in Hubs, so be sure to master using them for gestures.
Conclusion
In this article, I summarized how to modify your existing avatar for use in Mozilla Hubs using Blender and an existing Hubs-specific avatar base.
I hope this article leads to more people using custom avatars in Hubs.
You can also add Hubs-specific features to your avatar using the Mozilla-made Blender add-on hubs-blender-exporter.
For example, if your avatar has blend shapes for opening the mouth, you can enable lip-sync linked to microphone audio.
I haven't tried it yet, so if you have the capacity, please give it a go.
Discussion