12
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ Did you find a solution ? $\endgroup$
    – toto_tata
    Commented Dec 12, 2017 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
    Commented Feb 7, 2018 at 20:47

4 Answers 4

3
$\begingroup$

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
$\endgroup$
2
  • 6
    $\begingroup$ It does not create a png file for the texture. Any solution ? $\endgroup$
    – toto_tata
    Commented Dec 12, 2017 at 11:22
  • 1
    $\begingroup$ @Regis_AG did you manage to create .png texture file? $\endgroup$ Commented Dec 6, 2018 at 6:33
1
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

ensure your object has uv's and then bake out the map you want to a texture using the bake section in the render settings.

$\endgroup$
1
  • 1
    $\begingroup$ What's the reason for baking in this case? $\endgroup$
    – brockmann
    Commented Oct 28, 2020 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .