Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import 3D scene (.obj file with .mtl file)

I bought a 3D Model of a room. The model is in the .obj format. Now, I'm trying to import this model into Unity3D.

The Model came with:

  • 5 x .obj files
  • 5 x .mtl files
  • n x .jpg files
  • n x .tga files

The .mtl files contained paths that do not exist on my PC. So I removed the paths. The images files (.jpg & .mtl) are in the same directory as the .obj files. When I tried to import the .obj files, the room has no material on it. I then tried to use the FBX converter (with "Embed media" checked) to convert the .obj to .fbx and still when I import it, there is no material on the 3D room (it's invisible). I also tried importing all the .jpg and .tga files to a folder underneath the root Assets folder in Unity then importing the .obj and .mtl files.

What am I doing wrong? Does Unity3D use the .mtl to determine where to find the image files required? Is there an import log that could possibly shed some light?


UPDATE [8/25/2015]

  1. I edited all my .mtl files and removed the paths so its just the image filename (i.e. map_Ka Arch 53-wood 14.jpg).

  2. I copied all my .jpg and .tga files to a "Textures" folder in the same directory.

  3. I used the FBX Converter to convert the .obj files to .fbx.

  4. Imported the .fbx into Unity3D.

It still creates a model with no material (invisible) on it but the material folder it automatically creates upon import has much less files in it and those files map to images I imported under my Assets folder -- maybe this is progress? Not sure...

UPDATE [8/25/2015] #2

Possibly my model is importing correctly but I'm not setting something right? My .fbx model that I imported has number of Mesh filters underneath it. Each Mesh filter's Albedo does map to an image that I imported underneath my Assets folder (see screen shot) but still still when I drag the root model into my scene it is transparent -- why?

UPDATE [8/27/2015]

I was not able to get the .obj / .mtl combo working. I was able to get the author to convert to fbx so I'm trying to get that working as well (same issues I'm having with my converted fbx files). I create a new SO question at this point (Imported .fbx model Is Transparent)

enter image description here

enter image description here

like image 834
Mike6679 Avatar asked Aug 25 '15 18:08

Mike6679


Video Answer


1 Answers

  • use fbx (convert obj to fbx, obj doesn't work)
  • import fbx as asset
  • import textrure images files as asset
    (image naming: modelname_Texture_0.jpg modelname_Texture_1.jpg etc, fbx name: modelname.fbx)
  • select the model from favorites -> all models
    in the inspectors tab under materials
  • select import materials > material naming
  • select model name + model's material
    material search
  • select local material's folder
  • click apply
    done
like image 121
user7029091 Avatar answered Sep 27 '22 18:09

user7029091