Author Topic: Loading texture from mtl  (Read 140 times)

Outpost31d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Loading texture from mtl
« on: December 11, 2017, 01:09:13 AM »
I have loaded this model https://poly.google.com/view/dfY0OA_opYz into Meshmixer but I cannot get the textures to load? I opened the obj file to see if there were any spaces in the name but there are none.

MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1223
    • View Profile
Re: Loading texture from mtl
« Reply #1 on: December 11, 2017, 10:30:15 AM »
This object does not ship with a "texture" which would need a texture image file....
Instead its .mtl defines different "materials" for this single object.
MM does not support different materials on a single object - sorry.

As it is coloured pretty simple I would use SCULPT and its paint brush setting refinement disabled and apply per vertex color instead.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.

Outpost31d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Loading texture from mtl
« Reply #2 on: December 11, 2017, 11:14:03 PM »
Thanks for your help, I am trying to understand these files better so I have listed what I think these mean so far from looking at http://paulbourke.net/dataformats/mtl/

Just to be clear the example below of the tree I asked about is a material file, as it has no reference to a texture?

newmtl Sketch - Default (Instance)-165138   <--------name of the material (not sure what the Default-165138 means?
Kd 0.3612814 0.3264796 0.08044741           <--------diffuse reflectivity the numbers represent r g b values
Ks 0.2941176 0.2941176 0.2941176             <--------specular reflectivity the numbers represent r g b values
illum 2                                                        <--------illumination model the 2 is "highlight on"

Where as this file below has the texture reference on the bottom so the texture would show in Meshmixer?

newmtl material_0                                        <--------same as above
Ka 1.000000 0.000000 0.000000                   <--------ambient reflectivity the numbers represent r g b values
Kd 1.000000 1.000000 1.000000                   <--------same as above
Ks 0.000000 0.000000 0.000000                   <--------same as above
Tr 1.000000                                                 <--------seems this is not defined https://github.com/syoyo/tinyobjloader/issues/43
illum 0                                                         <--------same as above
Ns 0.000000                                                <--------specular exponent
map_Kd model_texture.jpg                            <-------reference to texture


MagWeb

  • Administrator
  • Hero Member
  • *****
  • Posts: 1223
    • View Profile
Re: Loading texture from mtl
« Reply #3 on: December 12, 2017, 03:20:58 AM »
Yep, the second .mtl loads the texture .jpg if you open the .obj in MM.
(the .obj points to the .mtl which points to the .jpg or a different supported image format).
All 3 files need to be in the very same directory.
I'm just a user as you are. Being no Autodesk employee: I do not know where this road will lead to, nor do I claim to've all stuff got right.