Open lucasjinreal opened 2 years ago
If there is only one element in the ply file (I can only imagine it's like that since I have no idea what your duck
is), trimesh.load
returns Trimesh
instance. With more elements it should return Scene
instance instead. Scene
has geometries instance variable as expected. Quick fix (pyrender.Scene.from_trimesh_scene
iterates over geometries inside, so for loadedMesh
being Trimesh
it fails the same as your code):
loadedMesh = trimesh.load(plyPath)
if isinstance(loadedMesh, trimesh.Trimesh):
trimeshScene = trimesh.Scene()
trimeshScene.add_geometry(loadedMesh)
else:
trimeshScene = loaded_mesh
scene = pyrender.Scene.from_trimesh_scene(trimeshScene)
duckmesh = Mesh.from_trimesh(list(duck.geometry.values())[0]) AttributeError: 'Trimesh' object has no attribute 'geometry'