Page MenuHome

Fix T96763: New OBJ Exporter Incorrectly saving the materials in the MTL file
ClosedPublic

Authored by Aras Pranckevicius (aras_p) on Apr 1 2022, 12:53 PM.

Details

Summary

Original report (T96763) only reported the issue of double-space before the texture path, but while adding test coverage I found some other issues that I fixed while at it:

  • Incorrectly emits two spaces between map_Xx keyword and the texture path, leading to some 3rd party software not finding the textures,
  • Emissive texture map (map_Ke) was not exported,
  • When Mapping node is used on the texture UVs, the "Location" and "Scale" values were mixed up (location written as "scale", scale written as "location).

Added gtest coverage; the attached files should get added into subversion tests repository into appropriate places.

Note: the exported texture paths are not quite correct -- as in they don't match any options of the old OBJ exporter. The old exporter had "Path Mode" setting, which the new one does not have; and none of the path mode settings completely matched behavior of the new one, when textures are not in the same folder as the source file. But fixing that sounds like a way larger change, so that I'll try to do separately. This issue has been mentioned as part of T96399 report.

Diff Detail

Repository
rB Blender