Textures from MTL?

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"

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”.

run the .obj through autodesk fbx converter and import that file.

I’m interested in how that helps, can you explain please?

it allows to embed the texture into the fbx file while keeping the originla obj’s texture mapping.

1 Like

Thank you so much :slight_smile: Thanks to you two I was able to find my textures and apply them to my model.

1 Like

Just use the OBJMTLLoader and see the example provided with Three.JS: three.js/examples/webgl_loader_obj_mtl.html at master · mrdoob/three.js · GitHub