Importing Textures Into Unity From an FBX File - Meshola - web based mesh content creation ;

Meshola -- web based mesh content creation

Home Log In Facebook Contact Keep Me Posted Public Meshes Source Code Articles API & Applications

Importing Textures Into Unity From an FBX File

The term 'material' is used when discussing meshes and how they look. A material can have several components. The first is a color. The second is a texture file that is mapped to the UV on the mesh, and the third is the shader that's used with the mesh.

When you import an FBX file into Unity that has materials and texture files associated with it you have two goals. The first goal is to be able to be able to uniquly associate a material with a mesh, and the second is to be able to re-use texture files.

The FBX format lets you provide a name to a material. This name lets you associate a name with a color and a texture file. Let's say you have two meshes with material names SideOne and SideTwo. Lets say that SideOne and SideTwo share a texture file called "stone.jpg" but have different tints, one more reddish and the other more greenish, like the holes in these stone walls.

If you import this into Unity, the default behavior will be to create a material called "stone", which is the name of the texture file, and to ignore the color properties of the material that you create and set the color to white. You will therefore lose the names of the materials that you created and the color properties, leaving only the texture file.

In order to presever the use of the material names there is a simple fix. In the inspector for the object set the Material Naming property to "From Model's Material", as shown in this inspector