From aa45f2654d5dd45a922e68a3dd59093f4f00c694 Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Fri, 9 Aug 2013 21:13:56 +0000 Subject: [PATCH] patch [#36407] Triangle strip support in PLY file importer from Eric Saari (esaari1) --- io_mesh_ply/import_ply.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index 6c80a3900..a59c94d6d 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -243,6 +243,8 @@ def load_ply_mesh(filepath, ply_name): elif el.name == b'face': findex = el.index(b'vertex_indices') + elif el.name == b'tristrips': + trindex = el.index(b'vertex_indices') mesh_faces = [] mesh_uvs = [] @@ -286,6 +288,13 @@ def load_ply_mesh(filepath, ply_name): for j in range(len_ind - 2): add_face(verts, (ind[0], ind[j + 1], ind[j + 2]), uvindices, colindices) + if b'tristrips' in obj: + for t in obj[b'tristrips']: + ind = t[trindex] + len_ind = len(ind) + for j in range(len_ind - 2): + add_face(verts, (ind[j], ind[j + 1], ind[j + 2]), uvindices, colindices) + mesh = bpy.data.meshes.new(name=ply_name) mesh.vertices.add(len(obj[b'vertex'])) -- GitLab