如何导入3D场景(带.mtl文件的.obj文件)

Mik*_*679 6 import unity-game-engine material fbx

我买了一个房间的3D模型.该模型采用的.obj格式.现在,我正在尝试将此模型导入Unity3D.

该模型带有:

  • 5x .obj档案
  • 5x .mtl档案
  • nx .jpg档案
  • nx .tga档案

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

可能我的模型正确导入但我没有设置正确的东西?我.fbx导入的模型下面有多个Mesh过滤器.每个网格滤镜的Albedo都会映射到我在Assets文件夹下面导入的图像(参见屏幕截图),但是当我将根模型拖到我的场景中时它仍然是透明的 - 为什么?

更新[8/27/2015]

我无法让.obj/ .mtlcombo工作.我能够让作者转换为fbx,所以我也试图让它工作得很好(我转换的fbx文件也有同样的问题).我此时创建了一个新的SO问题(导入的.fbx模型是透明的)

在此输入图像描述

在此输入图像描述

Mat*_*att 1

最简单(也是正确)的方法是不使用 .mtl 文件。而只是引入纹理和模型,然后在 Unity 中创建材质。作为起点,最好使用标准着色器。然后只需将纹理拖动到材质上的正确属性即可。

如果网格中的 UV 不正确,则上述方法有可能不起作用,但很有可能会起作用

您没有提到纹理的名称,但想必它们会与属性名称大致匹配。例如,_d_ 可能是Diffuse/ Albedo

编辑:在上述不是一个选项的情况下(比如您的复杂对象),您可以通过在模型的导入设置中使用Import Materials,Material Naming和选项来成功。Material Search但是,这假设至少纹理引用位于 .obj 内,但情况可能并非如此。