How to Import an FBX into Unity, Map Materials, and Fix FBX Bone and Mesh Errors | VRChat Tutorial

4 min read 1 month ago
Published on Aug 02, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, we'll walk through the process of importing an FBX model into Unity, mapping materials, and fixing bone and mesh errors specifically for VRChat avatars. This guide is essential for anyone looking to create and upload custom avatars from Blender to VRChat, ensuring all elements are correctly set up and optimized for performance.

Chapter 1: Important Blender FBX Export Settings

To ensure a smooth import into Unity, follow these steps when exporting your FBX from Blender:

  1. Set Scaling Correctly

    • Open your Blender project.
    • Make sure to apply scale transformations by checking the following:
      • FBX Unit Scale: Set to 1.
      • Apply Transform: Checked.
  2. Keep Blender Open

    • Leave your Blender project open to facilitate any quick adjustments later on.

Chapter 2: Import Textures and Optimize Them

Before importing your FBX model into Unity, you'll need to prepare your textures:

  1. Import Textures

    • Open your textures folder in Unity.
    • Drag and drop all texture files into the designated folder.
  2. Set Texture Formats

    • Select all textures, and in the inspector:
      • Check Alpha is Transparency for PNGs with transparency.
      • Set Max Size to 2048 for regular textures.
    • For normal maps and detailed textures like tattoos:
      • Select them and set Max Size to 4096 for higher quality.
    • Click Apply to save these settings.

Chapter 3: Import FBX and Set up Rigging

Now that your textures are ready, it's time to import your FBX model:

  1. Import the FBX

    • Drag your exported FBX file into the Unity assets folder.
  2. Fix Normal Map Warnings

    • If prompted, click Fix to adjust normal map settings automatically.
  3. Configure Model Settings

    • Select the imported FBX and navigate to the Model tab:
      • Enable Legacy Blend Shaped Normals to prevent glitches.
    • Switch to the Rig tab:
      • Change Animation Type to Humanoid and click Apply.

Chapter 4: Fix Bones and Weight Paint in Blender

If there are issues with bone assignments, follow these steps to correct them in Blender:

  1. Open Blender and Edit Armature

    • Select your armature and enter Edit Mode.
    • Check the parent relationships of bones (e.g., ensure ears are parented to the head, not hips).
  2. Create New Bones if Necessary

    • If needed, create new bones for hair or other elements by selecting the head bone and using the E key to extrude.
  3. Re-Export the FBX

    • After making adjustments, export the FBX again with the same settings as before.

Chapter 5: Extract Materials from FBX

Once your model is imported, extract materials for better organization:

  1. Select and Extract Materials
    • Right-click on the materials and select Extract from Prefab.
    • Choose the already created materials folder for extraction.

Chapter 6: Add Avatar Descriptor

To finalize your avatar setup, add an avatar descriptor:

  1. Add VRC Avatar Descriptor

    • Select your model in the hierarchy.
    • Click Add Component and search for VRC Avatar Descriptor.
  2. Set Up View Position

    • Enable the gizmo to position your view ball.
    • Adjust the view ball to sit between the eyes, about halfway out the nose for optimal visibility.

Chapter 7: Remap Different Materials to your FBX

For convenience when updating models:

  1. Create and Assign Materials

    • If needed, create new materials and assign them to specific parts of the avatar.
    • Use the Apply button to save these changes.
  2. Material Remapping

    • Drag and drop materials to replace existing ones, ensuring your avatar keeps the new mappings even after re-importing from Blender.

Conclusion

By following these steps, you've successfully imported an FBX model into Unity, set up and optimized textures, configured rigging, and added necessary components for your VRChat avatar. Remember to test your avatar in Unity and make adjustments as needed. For future projects, consider saving optimized materials to streamline your workflow. Happy avatar creating!