0
$\begingroup$

The exported material names and texture names are wrong. Could you explain why?

Here is a structure of my cube: enter image description here

Here is the cube itself (to show that the textures work): enter image description here

However, the exported obj and material files look strange. Why?The first texture title is omitted, and the rest are not named as in the blender project.

    # Blender v2.79 (sub 0) OBJ File: 'cube_v2.blend'
    # www.blender.org
    mtllib cube_v2.mtl
    o Cube_Cube.001
    v -1.000000 -1.000000 1.000000
    v -1.000000 1.000000 1.000000
    v -1.000000 -1.000000 -1.000000
    v -1.000000 1.000000 -1.000000
    v 1.000000 -1.000000 1.000000
    v 1.000000 1.000000 1.000000
    v 1.000000 -1.000000 -1.000000
    v 1.000000 1.000000 -1.000000
    vt 0.000000 0.000000
    vt 1.000000 1.000000
    vt 0.000000 1.000000
    vt 1.000000 0.000000
    vt 0.000000 0.000000
    vt 1.000000 1.000000
    vt 0.000000 1.000000
    vt 1.000000 0.000000
    vt 1.000000 1.000000
    vt 0.000000 0.000000
    vt 1.000000 0.000000
    vt 0.000000 1.000000
    vt 1.000000 1.000000
    vt 0.000000 0.000000
    vt 1.000000 0.000000
    vt 0.000000 1.000000
    vt 1.000000 1.000000
    vt 1.000000 0.000000
    vt 1.015873 1.000000
    vt 0.000000 0.000000
    vt 1.015873 0.000000
    vt 0.000000 1.000000
    vn 0.0000 1.0000 0.0000
    vn 0.0000 -1.0000 0.0000
    vn 1.0000 0.0000 0.0000
    vn -1.0000 0.0000 0.0000
    vn 0.0000 0.0000 -1.0000
    vn 0.0000 0.0000 1.0000
    usemtl mtl001
    s off
    f 4/1/1 6/2/1 8/3/1
    f 4/1/1 2/4/1 6/2/1
    usemtl mtl001_texture2_256x256.png
    f 7/5/2 1/6/2 3/7/2
    f 7/5/2 5/8/2 1/6/2
    usemtl mtl001_texture3_256x256.png
    f 8/9/3 5/10/3 7/11/3
    f 8/9/3 6/12/3 5/10/3
    usemtl mtl001_texture4_256x256.png
    f 2/13/4 3/14/4 1/15/4
    f 2/13/4 4/16/4 3/14/4
    usemtl mtl001_texture5_256x256.png
    f 4/17/5 7/5/5 3/18/5
    f 4/17/5 8/3/5 7/5/5
    usemtl mtl001_texture6_256x256.png
    f 6/19/6 1/20/6 5/21/6
    f 6/19/6 2/22/6 1/20/6

Material file:

    # Blender MTL File: 'cube_v2.blend'
    # Material Count: 6

    newmtl mtl001
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture1_256x256.png

    newmtl mtl001_texture2_256x256.png
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture2_256x256.png

    newmtl mtl001_texture3_256x256.png
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture3_256x256.png

    newmtl mtl001_texture4_256x256.png
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture4_256x256.png

    newmtl mtl001_texture5_256x256.png
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture5_256x256.png

    newmtl mtl001_texture6_256x256.png
    Ns 96.078431
    Ka 1.000000 1.000000 1.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ke 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd texture6_256x256.png
$\endgroup$
0
$\begingroup$

In Blender, a "Texture" is a slot that can contain a picture file (or something else, like a procedural, point cloud...). It is omitted when exporting, because in Obj a texture is a picture file. So your first material, mtl001, looks perfectly fine.

Are your sure your mtl002, mtl003 etc are actually assigned to some faces ? (In edit mode, select your material slot, select some faces, hit Assign under the slots list).

Try viewing your cube in Material shading instead of Texture shading, it will show you if the materials are correctly assigned.

$\endgroup$
  • $\begingroup$ Thank you for your answer. It works now. The materials were not assigned to faces. $\endgroup$ – vadtam May 1 '18 at 11:59

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.