Texture PNG not exported with mtl

Hello, when I want to export to Obj. format, blender makes me an mtl. file but does not export the textures on the code line of the mtl. file, so when I want to import my Obj. file into another software I do not have any textures.

Adoma.mtl (8.4 KB)

I don’t think the Blender OBJ exporter can handle node-based materials in this configuration:

You’d need to connect the texture directly into a material surface without other nodes, perhaps Diffuse BSDF or Principled BSDF. The glTF exporter does handle this case:

2 Likes

ACTUALLY glTF export works but after that it does not allow me to have OBJ format. with the texture, I tried to import the glTF. but by redoing the OBJ export. I return to the starting point of my problem

To prepare the model for export to OBJ+MTL it looks like it’s necessary to:

  1. Edit all materials to use a simplified configuration:

  1. Modify the .blend to unpack external resources

  1. Choose a “path mode” as needed when exporting the OBJ+MTL, I chose “Copy”:

Maybe there are other ways, but that worked for me.

1 Like

If you open the exported .mtl file in a text editor, you should then see a map_Kd entry under each material declaration:

newmtl Material_1.020
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 2
map_Kd Image_1.020.jpg

It’s work thank you !

Do you know how to edit all the materials at once for next time?

The only way I know to do this “batched” in Blender would be with a Blender Python API script. Probably there are non-Blender tools for glTF-to-OBJ conversion, which might be another way to do the same thing.