Summary:
Closes https://github.com/facebookresearch/pytorch3d/issues/2001.
`save_obj` currently omits UV coordinates and face UV indices unless `texture_map` is also supplied. This loses UV topology when exporting mesh optimization snapshots or meshes whose UVs describe non-color data, unless a redundant texture image and material file are written for every OBJ.
Save UVs whenever both `verts_uvs` and `faces_uvs` are supplied. Material headers and `.mtl`/`.png` files still require a texture map. The public signature is unchanged, and the docstring describes the independent UV export.
The regression test round-trips UV coordinates and distinct face UV indices, both with and without normals, and checks that no material references or sidecar files are created.
## Validation
- Confirmed both regression subcases fail on unchanged main because exported faces omit UV indices.
- Six targeted CPU OBJ IO tests pass: the new regression, existing texture export, normal export, combined normal/texture export, invalid texture inputs, and the pluggable IO texture export.
- Black, flake8, and `git diff --check` pass for the changed files.
- Native extension/full-suite validation was unavailable: the installed MSVC 14.20 toolchain fails while compiling the installed PyTorch headers (C2642/C2737). The targeted tests ran the actual Python OBJ IO code with a local import-only placeholder for `_C`; it exposes only two Pulsar default constants and raises on any native API access. No native operations were exercised. CI should verify the standard test runner with a built extension.
Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/2047
Reviewed By: MichaelRamamonjisoa
Differential Revision: D119957610
Pulled By: bottler
fbshipit-source-id: 8ddbbf42b13c264a8f93d699fbbfe96eaa2c0650