mikedh / trimesh

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

AttributeError: 'list' object has no attribute 'area_faces' #2239

Open Wenxuming711 opened 2 weeks ago

Wenxuming711 commented 2 weeks ago

i am facing this issue while using trimesh how can i overcome this issue? File "/root/blender/blender-3.3.1-linux-x64/custom-python-packages/lib/python3.10/site-packages/trimesh/sample.py", line 49, in sample_surface face_weight = mesh.area_faces AttributeError: 'list' object has no attribute 'area_faces'

Theyiot commented 2 weeks ago

I don't know how you load your variable mesh but it ends up being a list instead of a Trimesh.Mesh (thus Python does not find an attribute area_faces for a list). It may be a list of mesh (in which case you would have to loop through all the meshes or join them before accessing the variable area_faces) or a list of something else and something in your code is wrong.