I'm playing around with Google's new Augmented Reality SDK. Their example project contains an .obj file but its' textures are not in a .mtl file, put a .png file; no .mlt file at all (example for an Android robot model below).

From a little research I take this is not the 'standard' procedure of exporting a model / it's texture in the .obj format from Blender (or similar programs).

Is there a way to still achieve this (textures in .png instead of .mtl) with Blender?

enter image description here

  • $\begingroup$ Did you find a solution ? $\endgroup$ – Regis_AG Dec 12 '17 at 11:21
  • $\begingroup$ The way Google did it appears to be a very simplistic way and I wasn't able to find any converter to do this. However, I found updated code to handle MTL files instead of trying to find this magical diffuse image converter. See the second answer: stackoverflow.com/questions/45985643/… $\endgroup$ – abeauchamp Feb 7 '18 at 20:47

The .mtl file is only a material definition file which contains references to textures.

if you want to export obj with .mtl and textures you need to make sure you follow these steps:

In your OBJ export menu:

  • Make sure material export is ticked

enable material export

  • Set the path mode on COPY

 path mode

You will see that in your target folder you now have

  • An obj file which contains your mesh information
  • An mtl file which contains material definition
  • All tetxure files referenced in the .mtl
  • 4
    $\begingroup$ It does not create a png file for the texture. Any solution ? $\endgroup$ – Regis_AG Dec 12 '17 at 11:22
  • $\begingroup$ @Regis_AG did you manage to create .png texture file? $\endgroup$ – Khurram Shehzad Dec 6 '18 at 6:33

To export an image texture at Blender do the following:

Select your object and enter in edit mode. Select all vertices/faces (press 'a'). Then start the UV Mapping, press 'u'. And Select one of the options of the UVMapping. You must test the best option for you model.

enter image description here

Then go to the UV/Image Editor:

enter image description here

Export UV Layout at the menu, and save your image.

enter image description here


Another easy way, but off topic way, to get a png out of an mtl, is to make a Roblox account, download Roblox studio.

Make a new baseplate game, insert a meshpart and then go to View -> Properties and then enable properties tab, then look at the properties tab of the meshpart and then you should see a folder button on the side of the mesh section, and then click it, insert your mesh, and under the mesh id, you should see a texture.

Copy the id, only the numbers, then type in exactly this and replace (insert id here) with your id: roblox.com/library/(insert id here)/name and then it should redirect you to a link with the image.

If it has an image of a piece of paper and an hourglass, you need to wait for it to be an approved image.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.