In this article, we will explain how to convert an FBX humanoid-avatar file into VRM.
We will convert FBX into VRM with Unity.
If you would like to upload the file to STYLY, please open it with Unity version Unity 2019.4.x, 2019.3.x.
Please check the STYLY Document page for the latest Unity versions that STYLY supports.
Begin by opening Unity, and import UniVRM to use VRM file in Unity.
Download the latest .unitypackage from the following site.
Open this URL. The screen shown below will appear. The one highlighted in the red box will do; basically, download the latest version.
After downloading it, open a new project with Unity.
Double-click the UniVRM’s unitypackage file downloaded earlier to bring up the following window on Unity’s screen. Press ‘All’ and then ‘Import’.
Now you can use VRM files in Unity!
Adjust the Model Data
Import the FBX model that you want to translate into VRM to Unity.
You can import the file by dragging it onto the Assets folder in the Project window.
Select the imported model and press the ‘Rig’ tab in the Inspector window. Then, set ‘Animation Type’ to Humanoid and click ‘Apply’.
The ‘Configure…’ button above it will be enabled. Click it to open another Scene.
In this Scene, we will check the bones. The problematic bones are shown in red, so if you don’t have any ‘red’ bones, go back to the original Scene by clicking ‘Done’ at the bottom.
If you have the red ones you need to correct them. Some errors could be caused by incorrect automatic identification when importing FBX.
In this bone-setting window, the essential bones are shown with the ‘solid’ circle that is highlighted in the red box below. The ‘dotted’ circle highlighted in the blue box means that the specified bone is non-essential.
These markers could be helpful when looking into the errors.
In the case shown here, ‘Spine1’ set as Spine seems to be problematic.
To fix it, we set the ‘Spine2’ bone as Spine, which was originally assigned to Chest that is not an essential bone. However, this kind of correction could cause a problem, for example, when uploading the model to VRoid Hub (in fact, we couldn’t upload the model without ‘Chest’, so we re-added it). Therefore we recommend adding a bone in another way (e.g. adding a new bone with Blender).
If you corrected something, click ‘Apply’ and then ‘Done’.
The Settings for Materials
After completing the bones, place the object in the Scene temporarily.
Next, we will set up the shader for the material.
You cannot change the shader of the material that was set when importing the model, so we must create a new material and assign it. Right-click on the Project window and select ‘Create > Material’ to create a new material. You can assign the material by dragging it into the model in the Scene view.
You can set the texture in the box highlighted red in the following screenshot. Click it to open the Selection window. Alternatively, you can drag the texture into the box to set it.
Select the created material (①) and select a shader (④) under ‘VRM’ (③) from the drop-down on the Inspector (②).
For VRM, the developer recommends using the shaders under ‘VRM’ (③) or ‘Standard’ at the top.
In this example we have assigned ‘MToon’, but ‘UnlitTexture’ is also commonly used.
We recommend selecting all the materials and changing the shader simultaneously.
After setting up the materials, check the other details next.
The points to check are:
・ The position of the model > Is it at the origin (0,0,0)?
・ The scale of the model > Are the scale factors of X, Y and Z all set to 1.0?
・ The direction of the model > Is it facing in the Z-axis direction?
After checking them, we finally start converting the model.
Let’s Convert the Model
After checking the above, select the object in the Hierarchy window (①) and select ‘VRM > UniVRM > Export humanoid’ in the menu (②).
This will bring up the window pictured below. Fill in ‘Author’ to enable the ‘Export’ button. Fill all the checkboxes and select ‘Export’.
When pressing ‘Export’, it brings up a window in which you select the name and the folder. As a lot of folders will be created when converting, we recommend creating a folder under ‘Assets’ to keep them tidy.
The snapshot below shows how it looks after the conversion. The folders created when converting the model are highlighted by the red box in the image below.
You can find the VRM prefab in it, so select it.
After selecting the prefab, the section to set the information for VRM (highlighted in the blue box) appears in the Inspector window. Fill them in.
・Reference (if any)
[Personation / Characterization Permission]
・A person who can perform with this avatar (Only Author / Explicitly Licensed Person / Everyone)
・Permission to perform violent acts with this avatar (Disallow / Allow)
・Permission to perform sexual acts with this avatar (Disallow / Allow)
・For commercial use (Disallow / Allow)
・Other License URL (if any)
[Redistribution / Modification License]
・(Selections about redistribution / modification)
Please fill each field.
Once the set-ups are finished, delete the pre-conversion FBX object in the Hierarchy window and place the converted VRM prefab in the Scene.
With the VRM object in the Hierarchy selected, select ‘VRM > UniVRM > Export humanoid’ in the menu as before. But, this time, uncheck the highlighted in the red box in the screenshot below. Export the model in this state.
As this is the final export, you can export to a location other than Unity’s project file (e.g. your Desktop).
If you export it under the ‘Assets’ of the Unity project, a lot of folders will be created. However, if you export to the directory that is not the Unity’s project file (the Desktop etc.), only the .vrm file will be created, so you just need to handle one file.
We could say that all information is now packed into the .vrm file.
And that’s it! We have finished converting the model successfully!
You can use it as you like, uploading to VRoid Hub or VRC, etc.
Upload to STYLY
The following is for people who want to upload the converted avatar to STYLY.
Install the STYLY’s Unity plugin from the following official STYLY site: https://styly.cc/ja/download/
Double-click the downloaded .unitypackage file to import it.
Once it’s imported, it brings up the following window. Type in the E-mail address and the API key.
Drag and drop the VRM object in the Hierarchy into ‘Assets’ in the Project window. It converts the object into the prefab.
After converting into the prefab, right-click the prefab in the Project window and select ‘STYLY > Upload Prefab or scene to STYLY’.
Once the ‘upload completed’ window pops up, let’s move on to STYLY.
In STYLY Editor, go to ‘Assets > 3D model > My Models’. Now, you can see the model uploaded.
That’s it for this tutorial!