Blender To Unity



Importing a blender model as fbx is a common task when developing games for Unity 3D. In this tutorial we describe the steps you need to import the model, material and textures.

  1. Export Blender To Unity

.There's one crucial bit I forgot to explicitly show you - save your.blend file directly to the Assets folder of Unity (if you hadn't guessed. Either you could recreate the effect in Unity, thus negating the problem entirely and leading to potentially cooler results, or you could just fix and export the thing. Reanimate in Unity. Rather than trying to get the object and its animations to export from Blender into a usable format, you could export the model and reanimate it in unity.

First things first you have to setup a project and a scene in Unity 3D:

After that you have to place the FBX-file of your Blender-model into a folder (I name it models usually). We use our spaceship model for this turorial.

Models for in Unity

Blender To Unity

When you select the model the Unity-inspector shows the following, don’t forget to set the scale-factor to 1, default is 0,01:

The material for your mdoel is generated automatically in the subfolder Materials but the texture for the UV-mapped model is not added, you have to add the diffuse and if you have a normalmap into the Materials-folder and assign the textures to your material:

Material folder for the fbx-models in Unity

In our case we have a Bumped Specular material for which we add the textures like that:

That’s all and this is the result you see in your scene:

Imported model in the Unity-scene

Requirements

  • Blender properly installed in the system.
  • Place the .blend files inside the Unity project’s Assets folder (or a subfolder inside Assets).
    You can open them for editing by double-clicking the file in Unity. After saving the file in Blender it will be automatically reimported when switching back to Unity.
  • Place all the texture files in a subfolder named Textures in the same folder as the .blend file. A subfolder named Materials will be automatically created by Unity.
    When assigning textures in Blender ensure to select the files located in the Textures folder. Unity 3D will automatically assign them to the materials in the imported object.

Assign textures to objects

  1. Choose the object and switch to Edit Mode (TAB).
  2. Mesh tab: Select the UV Map to asign the texture to. In Unity 3D the first UV Map is used for the texture and the second UV Map is used for lightmap.
  3. Select all faces in the UV Map (locate the cursor over the UV editor, then press A).
  4. Image > Open Image (Alt O), then choose the image file.
  • The texture is assigned to the selected faces.
  • The Textured Solid setting displays the texture in the 3D View.
  • Unity 3D will take the name for the material from the Source field (when By Base Texture Name is selected as Material Naming in Unity 3D).
  • The object’s Material name is ignored in Unity 3D (when By Base Texture Name is selected as Material Naming in Unity 3D).
  • The name of the object will be the same in Unity 3D.
  • The name of the mesh in Blender is ignored in Unity 3D.
  • A material with the name of the texture is created and the texture is assigned to it.
  • Note: If the material in Unity 3D doesn’t receive a texture, then ensure there isn’t a Material in the Blender scene with the same name.

Multiple textures in the same object

  1. Choose the object and switch to Edit Mode (TAB).
  2. Mesh tab: Select the UV Map to asign the texture to. In Unity 3D the first UV Map is used for the texture and the second UV Map is used for lightmap.
  3. Select the face or faces you want to assign the texture to.
  4. Image > Open Image (Alt O), then choose the image file.
  5. Repeat from 3. for each face or group of faces.
  • Only the faces selected in the UV Editor receive the texture.
  • The Textured Solid setting displays the texture in the 3D View.
  • The UV Editor shows the texture assigned to the focused face. The focused face is displayed with a different shading.
  • In Unity 3D a material is created for each texture that is assigned to the material. Each material takes the name of its texture.
  • The faces without a texture assigned will receive an unnamed default material.

Texture management

  • When a texture is loaded an Imagedata object is created for it. The available images are listed when clicking the Image icon.
  • The Source field points to the image file assigned to the selected Image object.
  • The textures can be quickly assigned to the selected faces by using the Image list.
  • The texture can be unassigned from the selected faces by clicking the X at the Image selector. The faces without a texture assigned receive an unnamed default material in Unity 3D.
  • The file the Image reads can be changed by editing the Source field, either directly or by selecting another file with the Open File icon.

When By Base Texture Name is selected as Material Naming in Unity 3D:

  • Unity 3D uses the Source field as name for creating the materials.
  • The name of the Image object is not relevant to Unity 3D. It can be freely renamed in Blender.

Materials

In all casesMaterials in Blender only export their diffuse color to the material in Unity 3D (gray 0.8 / 204 by default). Note: for the material color to be displayed in Blender’s 3D View the Textured Solid option must be disabled.

When a Material Name is required below and the object has no materials assigned then a default material is created in Unity 3D: unnamed

When By Base Texture Name is selected as Material Naming in Unity 3D: Conexant driver.

  • Unity 3D uses the Source field (the name of the image file) as name for creating the materials: File_Name (without extension)
  • The name of the Image data object is ignored in Unity 3D. It can be freely renamed in Blender.
  • If the object doesn’t have textures assigned or there are faces without texture then Unity 3D uses the name of the Material as name for creating the materials: Material_Name

Pocket neurobics port devices driver download. When Model’s Material is used in Material Naming in Unity 3D:

If the object has textures assigned:

  • Unity 3D uses the name of the Material and the name of the Image data object as name for creating the materials: Material_Name__Image_Name
  • Note that the name of the Image data object is used, NOT the Source field (image file name) as previously.
  • If the object has texture but no material assigned then None is used as material name.

If the object does not have textures assigned:

Export Blender To Unity

  • Unity 3D uses the name of the Material as name for creating the materials: Material_Name