Search Unity

Importing OBJ with MTL Texture doesn't work

Discussion in 'Editor & General Support' started by NiklasDanz, Nov 7, 2017.

  1. NiklasDanz

    NiklasDanz

    Joined:
    Nov 13, 2016
    Posts:
    5
    Hello,

    I'm trying to import an .obj file with the according .mtl texture into Unity. I've red that in order to get a texture to be applied to a model you have to put both of the files into the project simultaniously. I've tried it the following ways and with none of them the texture was applied to the model:
    1. Draging obj. and .mtl (names are the same, except for the extensions) into the Assets Folder
    2. Dragging .mtl into the Materials Folder and the .obj into the Assets Folder.
    3. Dragging .mtl into the Textures Folder and the .obj into the Assets Folder.

    The Material Settings of the .obj are as follows:
    - Import Materials: TRUE
    - Material Location: Use etxernal materials (legacy)
    - Material Naming: By base texture Name (I also tried "from models material")
    - Material Search: (Tried literally anything there, depending on the ways listed above).

    I've got this to work once. But I can't remember how, which is bugging me like hell.
    If you're trying to reconstruct this issue: This is the 3D model I used (forwards to Google Poly).

    Thanks a lot for your help,

    Niklas
     
  2. DMartinek

    DMartinek

    Joined:
    Oct 30, 2013
    Posts:
    2
    Hey,
    we have exactly the same problem since an update to 2017.2. We were able to load .OBJs with .MTLs fine before, but now the .mtl is ignored and only a default material is created.

    Maybe it's time for a bug report...
     
    BrainSlugs83 likes this.
  3. George-Dolbier

    George-Dolbier

    Joined:
    Sep 1, 2013
    Posts:
    9
    Bump. Either this was answered somewhere else and I can't find it. This is still an issue with 2019.1
     
    BrainSlugs83 and dinguspigeons like this.
  4. JAntonioCisneros

    JAntonioCisneros

    Joined:
    Oct 25, 2017
    Posts:
    2
    Hi.

    After decompressing both the .obj and the .mtl from the zip (it was a poly model from google) i changed the names of the files, like piano.obj and piano.mtl, just for better organization in my files, but after dragging them to unity (both at the same time), the materials were not aplied, the same as your case.

    If you, after decompressing the files, change the name to materials.mtl and model.obj, respectively, it can be succesfully imported to unity the model with the materials applied, no need to change anything in the editor. Note that both files need to be dragged at the same time.

    In fact, inside the folders in unity, once it is imported, you can delete the materials.mtl object and the model still remains with them. Then you can change the name in the project folder to "piano model" or wharever.
     
  5. JAntonioCisneros

    JAntonioCisneros

    Joined:
    Oct 25, 2017
    Posts:
    2
    *Change the name of the model in the project folders requires having the respective materials.mtl for it to actualize the name change without losing them, so it's recommended to not delete them after importation.