Hi, everyone,
Does anybody help me figure out why material information is not properly saved in a .mtl file?
I am a graduate student using Inventor to design models which are passed to a physics simulator, which accepts .obj files as object model files, for my research project about computer vision and dynamics. I tried to save a teapot model, whose body is glass (transparent) and lid is polypropylene (opaque) as show below, as .obj by clicking File -> Save As -> Save Copy As.
When I check the resultant .mtl file, I noticed that only one material is registered there as follows:
# WaveFront *.mtl file (generated by Autodesk ATF)
newmtl 236,241,239
Ka 0.925490 0.945098 0.937255
Kd 0.925490 0.945098 0.937255
Ks 1.000000 1.000000 1.000000
Ns 1000.000000
d 0.660000
although there should be two materials. Moreover, "d 0.660000", which controls transparency between 0.0 and 1.0, sounds weird becuase that is translucent rather than transparent or opaque. It contradicts my setting.
I tried another model like this
In this case, the blue body (actually white-ish because the blue colour is due to selection) is ABS plastic and the grey body is aluminum. Then I got this .mtl file:
# WaveFront *.mtl file (generated by Autodesk ATF)
newmtl 254,254,255
Ka 0.996078 0.996078 1.000000
Kd 0.996078 0.996078 1.000000
Ks 0.996078 0.996078 1.000000
Ns 1000.000000
d 1.000000
newmtl 235,235,235
Ka 0.921569 0.921569 0.921569
Kd 0.921569 0.921569 0.921569
Ks 1.000000 1.000000 1.000000
Ns 1000.000000
d 1.000000
As you can see, there are two materials in the .mtl file. I do not understand why the second assembly's materials are exported as .mtl correctly and the first one fails.
Actually, there is a difference in how they are modelled; the second model is desinged from scratch while the first one is converted from a mesh file uploaded on Thingiverse. But I cannot believe that it is the cause of the issue because the assembly's inertial properies which I also write into a file using Inventor API surely corresponds to the maretial setting, which implies materials are actually assigned to the bodies.
Does anybody have an idea about how to fix this issue? You can look into it with the attached .zip where the teapot assembly is saved.
Thanks in advance!
Atsushi
Hi, everyone,
Does anybody help me figure out why material information is not properly saved in a .mtl file?
I am a graduate student using Inventor to design models which are passed to a physics simulator, which accepts .obj files as object model files, for my research project about computer vision and dynamics. I tried to save a teapot model, whose body is glass (transparent) and lid is polypropylene (opaque) as show below, as .obj by clicking File -> Save As -> Save Copy As.
When I check the resultant .mtl file, I noticed that only one material is registered there as follows:
# WaveFront *.mtl file (generated by Autodesk ATF)
newmtl 236,241,239
Ka 0.925490 0.945098 0.937255
Kd 0.925490 0.945098 0.937255
Ks 1.000000 1.000000 1.000000
Ns 1000.000000
d 0.660000
although there should be two materials. Moreover, "d 0.660000", which controls transparency between 0.0 and 1.0, sounds weird becuase that is translucent rather than transparent or opaque. It contradicts my setting.
I tried another model like this
In this case, the blue body (actually white-ish because the blue colour is due to selection) is ABS plastic and the grey body is aluminum. Then I got this .mtl file:
# WaveFront *.mtl file (generated by Autodesk ATF)
newmtl 254,254,255
Ka 0.996078 0.996078 1.000000
Kd 0.996078 0.996078 1.000000
Ks 0.996078 0.996078 1.000000
Ns 1000.000000
d 1.000000
newmtl 235,235,235
Ka 0.921569 0.921569 0.921569
Kd 0.921569 0.921569 0.921569
Ks 1.000000 1.000000 1.000000
Ns 1000.000000
d 1.000000
As you can see, there are two materials in the .mtl file. I do not understand why the second assembly's materials are exported as .mtl correctly and the first one fails.
Actually, there is a difference in how they are modelled; the second model is desinged from scratch while the first one is converted from a mesh file uploaded on Thingiverse. But I cannot believe that it is the cause of the issue because the assembly's inertial properies which I also write into a file using Inventor API surely corresponds to the maretial setting, which implies materials are actually assigned to the bodies.
Does anybody have an idea about how to fix this issue? You can look into it with the attached .zip where the teapot assembly is saved.
Thanks in advance!
Atsushi
Hi! This one looks like a bug to me. I cannot explain the behavior. I need to work with the project team to understand it better. In the meantime, I tried it on Fusion. The result seems correctly. Please feel free to use Fusion to export to mesh obj files.
Many thanks!
Hi! This one looks like a bug to me. I cannot explain the behavior. I need to work with the project team to understand it better. In the meantime, I tried it on Fusion. The result seems correctly. Please feel free to use Fusion to export to mesh obj files.
Many thanks!
Can't find what you're looking for? Ask the community or share your knowledge.