マテリアルを当てはめる

Edit VRM models in Blender, export the model to Unity, and export it as a VRM file Part① FBX file

Introduction

When you add accessories, or change the pose of a VRM file using Blender,

if you export the file as a VRM, the changes will not be applied.

So, even if you want to use that avatar as a VRM file, you need to export the file as a different type, such as FBX, and edit the file in Unity to change it into VRM.

There are two ways to do this. ①Export as a FBX, and edit it in Unity, or ②Do not export the object, and import the .blender file with the edited VRM file, and use it as a model.

When you import a .blender file to Unity, you can use it as a object just like a FBX file, but if you edit it, the change will directly be applied to Unity too. (This may not be true If you are using old versions.)

My personal opinion is that if you use method①, it may be troublesome when there are any changes and you have to re-export the file from Blender, and import it to Unity again.

In this article, I will go through the steps for method①, and how to bring the file to STYLY.🐼

 

Related articles

How to use VRM files with Blender↓↓↓

 

 

How to link Blender and Unity without exporting objects as FBX’s. (This is the method② I mentioned above.)

Please check out this article too↓↓↓

https://styly.cc/tips/blender-vrm-export2/(To be updated soon)

 

How to add accessories↓↓↓

Exporting as a VRM

So, let’s export the file then. For this tutorial, I will export my very cute character with this new accessory.

可愛すぎません???

Isn’t she adorable???

Go to the menu, and select File>Export>FBX.

Export>FBX

Export>FBX

 

Please check the Export settings. The settings should be as in the image below.

Exportの設定

Export Settings

Main:Apply Scalings should be FBX All. Select Armature and Mesh.

Geometories:Select Apply Modifiers

Amatures:Select Only Deform Bones

Animation:Select Baked Animation

 

Once you are done with the settings, press Export.

 

Using in Unity

Enabling UniVRM

Open Unity. If you are planning to upload to STYLY, please use Unity version 2017.4.x.

In order to use VRM files with Unity, first import UniVRM.

You may be puzzled as we just exported the file as a FBX. I will explain why.

When you export a FBX file and import to Unity, you need to recreate material and set the texture files.

That is very tiring, and since we are using a FBX file that was originally a VRM file,

we can import the original VRM file to Unity and use the material from there. Isn’t that clever?

 

Please download the latest UniVRM .unitypackage from the URL below.

https://github.com/vrm-c/UniVRM/releases

When you open the URL, a window as in the image below will popup. The one squared in red should do. NOTE: please use the latest version.

UniVRMのダウンロード

Downloading UniVRM

 

Once the download is complete, please create a new project in Unity.

Double click the UniVRM unitypackage you just downloaded, and select all then click Import when a window popups, as in the image below.

UniVRMのインポート

Importing UniVRM

 

We can now use VRM files with Unity.

 

Importing the files

Next, we need to import the FBX file we exported, and the original VRM file to Unity.

If you want to keep things tidy in the Unity project,

I advise you to create a folder under Assets, and place the VRM file inside it.

You can add files to Unity by the drag and drop action.

ドラッグアンドドロップ

Drag and drop

 

If you have texture files for the accessory you added to the VRM file, please add the file to Unity too.

 

Bone settings

Then, we need to set the bones!

Select the FBX model you imported, go to the Rig tab in the Inspector window, and select Humanoid as a Animation Type, then click Apply.

Humanoidを選択

Select Humanoid

 

Once you click Apply, you will become able to click the Configure…. button above it, so please click it too. You will jump to another scene.

We need to check the bones in this scene. If they are all green, we are set, so please click done.

We are using a file that was originally a VRM, so normally there will be no errors here.

ボーンの設定

Bone settings

 

Material settings

Next, we need to change the material settings. Place the FBX model inside the scene. Drag and drop to the Hierarchy window.

Go to the Hierarchy window, and you will be able to find Body, Face, Hair, Skeleton inside the object. Check the inspector of Body, Face, and Hair, and you will find Materials are applied within Skinned Mesh Renderer.

Change the material files here to those of the original VRM file.

マテリアルが割り当てられています

Material files are applied

 

Look at the VRM file in the Project window. There should be a Materials file within the many files. Please open this.

マテリアルファイル

The Materials file

 

There should be material files for Body, Face, and Hair, so swap these files with that of the FBX file. You can just drag and drop again.

マテリアルをあてはめる

Appling Material files

 

We are done with the avatar material settings now. Next, we check the accessory material settings.

Right click inside the project window, and Create>Material to create a material file.

If you have any texture files, set them to the red squared place. You can drag and drop, or click the square and select the file from the popup window.

テクスチャの設定

Texture settings

Next, we need to set material shaders. Click ① Material , then click ②, ③ move the cursor to VRM, and select from ④.

It will be better if it matches the material files you just used. If there are any texture files, it is probably UnlitTexture.

If there are any transparent parts in the texture, you should use UnlitCutout or UnlitTransparent options.

If there are no textures and just colors, go to ③ and select Color from Unlit.

By the way, Unlit means that it is not affected by lights, but if you select MToon in ④, it will get affected by lights and look like a cartoon, so you can change the hair and body shaders according to your taste.

シェーダーの変更

Shader options

 

You can drag and drop materials to objects within the scene to apply them too.

マテリアルを当てはめる

Applying Materials

 

That will be all for preparations!

 

Exporting as VRM and uploading to STYLY

Well then, let’s upload the file to STYLY. It is a FBX file, so you can just directly upload it to STYLY!

OR, NOT. I originally thought that was possible, but when I tried,

eyebrows and eyelashes mysteriously disappeared, and there was a half maked up ぽっぷる-chan (My model’s name) looking at me…

I’m sorry to disturb you during your makeup.

キャー!お化粧中よ!見ないで!

Stop! Please! I’m not ready yet!!

 

When I tried exporting the file as a VRM first, then upload it to STYLY, there was no trouble at all, so although I could not find out what the reason was, I advise that you go through the same steps.

 

So, please refer to the article below, and go through the steps after Other settings.

 

That will be all for this article! Thank you!