Importing OBJ to Unity

Viewed 6256

I have been supplied an .obj file - it comes by itself.

When I import it into Meshlab the model is perfect and is coloured. So I believe the material or texture is embedded.

However, when I import it into Unity (2019.3.0f6) it seems to just have default material - called defaultMat. And so appears grey.

How can I get it to have the right material/texture?

2 Answers

There are some ways to do this:

  1. If you have experience with Blender you can load the model into Blender and export it to fbx.
  2. There's this FBX Converter from Autodesk available for free and it doesn't need AutoDesk to be installed.
  3. If you want to keep the file as an .obj, try selecting the mesh file from the project window, then in the Inspector click on the Materials tab. From there you will see two buttons that will let you either extract the materials or the textures. If that isn't working then just import the textures into Unity manually and then recreate the material and reassign them to the right meshes.

Hope this helps!

The textures for your 3D model need to be stored in a folder called /Textures/, under the /Assets/ folder for Unity to find and link them to the material.

From the Unity docs

Note: You must store Textures in a folder called Textures, placed inside the Assets folder (next to the exported Mesh) within your Unity Project. This enables the Unity Editor to find the Textures and connect them to the generated Materials. For more information, see the Importing Textures documentation.

afaik Unity does not support textures embedded in .obj files. I think it does work for textures embedded in .fbx files though.

Related