TobiasLogic commited on
Commit
2c09d33
·
verified ·
1 Parent(s): e68486e

Add missing scipy dependency for trimesh glb export

Browse files

The 3D tab crashed with ModuleNotFoundError: No module named scipy. Root cause: grid_to_glb() sets mesh.visual.face_colors before exporting to .glb, which triggers trimesh a face-to-vertex color conversion (trimesh/visual/color.py, face_to_vertex_color -> mesh.faces_sparse -> geometry.index_sparse) that calls scipy.sparse.coo_matrix internally. trimesh treats scipy as an optional dependency and only raises the ImportError lazily when that code path is actually hit, so it never surfaced during the earlier CPU smoke test where scipy happened to already be present as a transitive dependency from something else.

Verified locally: reproduced the exact traceback (down to the same "shape=shape, dtype=data.dtype)" line) with trimesh installed and scipy absent, then confirmed installing scipy alone fixes it end to end (mesh exports to a valid 166KB .glb with face colors intact).

Files changed (1) hide show
  1. requirements.txt +1 -0
requirements.txt CHANGED
@@ -7,4 +7,5 @@ numpy
7
  Pillow
8
  huggingface_hub
9
  trimesh
 
10
  audioop-lts
 
7
  Pillow
8
  huggingface_hub
9
  trimesh
10
+ scipy
11
  audioop-lts