Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Textures from MTL?

Discussion in 'General Graphics' started by NOVA_POLARIS, Aug 25, 2015.

  1. NOVA_POLARIS

    NOVA_POLARIS

    Joined:
    Apr 13, 2015
    Posts:
    19
    I downloaded a 3d model online and after extracting I was given two files. A .OBJ and a .MTL. I was able to import the .OBG easily but it is not textured. I can also import the .MTL but I can't do anything with it. I also can't open it in photoshop. So can someone please tell me how to get the textures from the file into unity?

    UPDATE- Using wordpad I was able to get the following information. I am not sure if it is useful or not but I figured I would post it just in case.

    "# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
    # File Created: 14.06.2013 23:51:07

    newmtl 08___Default
    Ns 10.0000
    Ni 1.5000
    d 1.0000
    Tr 0.0000
    Tf 1.0000 1.0000 1.0000
    illum 2
    Ka 0.5882 0.5882 0.5882
    Kd 0.5882 0.5882 0.5882
    Ks 0.0000 0.0000 0.0000
    Ke 0.0000 0.0000 0.0000
    map_Ka C:\Users\Tommy\Documents\Game rips\Shrek the Third\Shrek\Shrek_Head_Legs.dds
    map_Kd C:\Users\Tommy\Documents\Game rips\Shrek the Third\Shrek\Shrek_Head_Legs.dds

    newmtl 02___Default
    Ns 10.0000
    Ni 1.5000
    d 1.0000
    Tr 0.0000
    Tf 1.0000 1.0000 1.0000
    illum 2
    Ka 0.5882 0.5882 0.5882
    Kd 0.5882 0.5882 0.5882
    Ks 0.0000 0.0000 0.0000
    Ke 0.0000 0.0000 0.0000
    map_Ka C:\Users\Tommy\Documents\Game rips\Shrek the Third\Shrek\Shrek_Body.dds
    map_Kd C:\Users\Tommy\Documents\Game rips\Shrek the Third\Shrek\Shrek_Body.dds"
     
  2. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433

    As far as I know .mtl files only specify some general material information like what texture to apply to what object. No image data is embedded. The actual texture file is the .dds file mentioned in the .mtl that you posted. It was a good idea to post this information as I now can tell you that if this model actually is "Shrek" from the movies, you can not use that. See how the texture path says "...\Game rips\..."? That is an indication, that the person who uploaded the model in the first place stole it from a game.
    On a side note - see how the path to the texture starts with "C:\"? That's what is called an "absolute path". You want to avoid those in your projects because if you move your project to another place all those links will break. You could possibly get into situations where things work fine on your computer but on no one else's because they installed to a different location. You should be using "relative paths".
     
  3. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
  4. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
  5. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    it allows to embed the texture into the fbx file while keeping the originla obj's texture mapping.
     
    Martin_H likes this.
  6. NOVA_POLARIS

    NOVA_POLARIS

    Joined:
    Apr 13, 2015
    Posts:
    19
    Thank you so much :) Thanks to you two I was able to find my textures and apply them to my model.
     
    SAOTA likes this.
  7. bestellenpreis

    bestellenpreis

    Joined:
    Mar 15, 2015
    Posts:
    26