Page MenuHome

Fix T96430: new OBJ exporter wrong normals for non-uniform scale, and wrong face order for negative scale
ClosedPublic

Authored by Aras Pranckevicius (aras_p) on Mar 14 2022, 8:57 PM.

Details

Summary

The new 3.1+ OBJ exporter did not have correct logic when faced with non-uniform & mirrored (negative on odd number of axes) object scale:

  • Normals were not transformed correctly (should use inverse transpose of the matrix), and were not normalized,
  • Face order was not "flipped" when transform has negative scale on odd number of axes (visible when using "face orientation" viewport overlay).

This revision fixes both issues, and adds gtest coverage, which should be comitted into tests subversion repo:

  • non_uniform_scale.blend into io_tests/blend_geometry,
  • non_uniform_scale.obj into io_tests/obj
  • suzanne_all_data.obj replaces existing file in io_tests/obj. Due to normalization of the normals, one normal has changed in a tiny way (0.3599 became 0.3600).

Diff Detail

Repository
rB Blender