Skip to content

Make pymeshlab imports lazy in exporter utilities - #3797

Open
AdityaKharmaleGoat7 wants to merge 1 commit into
nerfstudio-project:mainfrom
AdityaKharmaleGoat7:fix/lazy-pymeshlab-import
Open

AdityaKharmaleGoat7 wants to merge 1 commit into
nerfstudio-project:mainfrom
AdityaKharmaleGoat7:fix/lazy-pymeshlab-import

Conversation

@AdityaKharmaleGoat7

Copy link
Copy Markdown

Summary

This makes pymeshlab imports lazy in exporter code so importing non-meshing exporter functionality does not initialize pymeshlab unnecessarily.

Changes

  • move the pymeshlab import in exporter_utils.py into get_mesh_from_filename()
  • keep the pymeshlab.Mesh annotation available under TYPE_CHECKING
  • move the pymeshlab import in tsdf_utils.py into TSDF.export_mesh()
  • add a regression test that imports both exporter modules with pymeshlab unavailable

Scope

This intentionally does not change the dependency declarations in pyproject.toml. It is a small first step toward decoupling meshing dependencies and avoids changing installation semantics in the same PR.

Related to #3712

Afloat16 added a commit to Afloat16/nerfstudio that referenced this pull request Nov 9, 2026
Use a 600 x 800 input to exercise the height as the normalization scale.
The expected horizontal principal point is 379.5 pixels, while main
50e0e3c returns 299.6. All five fixtures fail on main and pass with the
patch using the real importer. Ruff 0.12.2 lint and format checks pass.

The earlier CI run reports the same 19 Pyright diagnostic locations and
messages as PR nerfstudio-project#3797 at the same base. Both Docker runs stop building
tiny-cuda-nn because pkg_resources is unavailable.

https://github.com/nerfstudio-project/nerfstudio/actions/runs/42401285154
https://github.com/nerfstudio-project/nerfstudio/actions/runs/37900213951
https://github.com/nerfstudio-project/nerfstudio/actions/runs/42401284860
https://github.com/nerfstudio-project/nerfstudio/actions/runs/37900214031

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant