diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index a59c94d6d05d561b7f108045b3057ee64f5b4c73..9cf5df6390adec0194d3eee908f19b2157be2dc6 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -245,6 +245,8 @@ def load_ply_mesh(filepath, ply_name): findex = el.index(b'vertex_indices') elif el.name == b'tristrips': trindex = el.index(b'vertex_indices') + elif el.name == b'edge': + eindex1, eindex2 = el.index(b'vertex1'), el.index(b'vertex2') mesh_faces = [] mesh_uvs = [] @@ -301,6 +303,10 @@ def load_ply_mesh(filepath, ply_name): mesh.vertices.foreach_set("co", [a for v in obj[b'vertex'] for a in (v[vindices_x], v[vindices_y], v[vindices_z])]) + if b'edge' in obj: + mesh.edges.add(len(obj[b'edge'])) + mesh.edges.foreach_set("vertices", [a for e in obj[b'edge'] for a in (e[eindex1], e[eindex2])]) + if mesh_faces: mesh.tessfaces.add(len(mesh_faces)) mesh.tessfaces.foreach_set("vertices_raw", unpack_face_list(mesh_faces))