mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
3.02k stars 583 forks source link

ImportError: cannot import name 'geometry_hash' from 'trimesh.viewer.windowed' #2311

Closed JBKacerovsky closed 2 weeks ago

JBKacerovsky commented 3 weeks ago

Thanks for a fantastic library. It comes in very useful for me all the time!

I ran into a small bug though. Trying to run the example examples/widget.py I got this error: ImportError: cannot import name 'geometry_hash' from 'trimesh.viewer.windowed'

It seems this function was renamed from geometry_hash to _geometry_hash in commit e68432c40261690e08c3388f1453a41cc62bbf61 but the import was not updated in trimesh/viewer/widget.py.

Changing the widget.py import in my venv site-packages to

from .. import rendering
from .trackball import Trackball
from .windowed import SceneViewer
from .windowed import _geometry_hash as geometry_hash 

fixed the issue for me.

mikedh commented 3 weeks ago

Thanks for the report! Should be fixed when #2312 is released.