How do I apply the .mtl file to my imported .obj object?

I was not able to get the 3D-Coat Applink to work. So I exported my blender mesh as an obj and imported it inside 3D-Coat. I already unwrapped it in Blender.

I painted it in 3D-Coat and saved it as an obj. It saved with a .mtl file.

I imported the obj into blender but it did not bring in the .mtl file. How do I apply the .mtl file to my mesh?

Also does anyone know why the 3D-Coat Applink does not work?

Thanks for any help with this entirely frustrating process.

The material file (mtl) should be read by the importer (there are multiple for obj now)… and translated into a shader setup… it depends also how 3Dcoat export it… Because it’s just a text file you also can read it…
Anyway: i think it would be by far better to make the applink work (obj was made a long time ago and doesn’t suit modern shader setups…)

Thanks. I finally got the applink to work but I will have to start from scratch. I just don’t know how to get the material (the mtl file) into Blender.

I appreciate your replying.

You can’t get the MTL file into Blender separately – as @Okidoki said, the OBJ importer handles that for you.

But there are any number of pitfalls, and without further information we can guess all day long. For all we know the file got incorrectly exported from 3DCoat, or has features Blender can’t handle.

Obvious things to check:

  • You’re in Material or Render preview
  • The MTL file has the same name as the OBJ file (it doesn’t have to, but if things fail that’s a common problem)
  • Textures are in the correct directory structure
  • Materials got imported but not assigned

Less obvious:

  • There is no support for certain features (like vertex colours)
  • The wrapper Blender uses to translate between node-based shading and OBJ’s pipeline style might fail on your 3DCoat file. It’s pretty basic (so says the fine manual).

Since OBJ files are human-readable, you could conceivably figure out where it fails. Or you could share the file and somebody else could.

There are two variables associated with materials in your OBJ file:

  • Material library: mtllib – the path and name of the mtl file
  • Material name: usemtl – the names of the materials within the mtl file

In the MTL file the materials are defined with newmtl. After that there can be more information such as texture and reflection mapping.

Hope this can help. Redoing things sucks.

And of course you are using UVs and not any special 3D coat trick… so if the material does have only one texture than just making a new shader setup might be easier… (even additional bump/normal shouldn’t be too hard)…

thank you both, especially Piranha for all the detail you went into to explain. I’m afraid a lot of it was over my head, given that I need true hand-holding step-by-step walkthroughs in lots of areas.

I got the Applink to work and somehow I was able to get the original material back into Blender.

I will, however, pursue learning how to do it manually.

Thank you both again…