diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-10 01:13:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-10 01:13:56 +0400 |
commit | aa45f2654d5dd45a922e68a3dd59093f4f00c694 (patch) | |
tree | 46f844592e0ac73100456b799c22d64717a7ee41 /io_mesh_ply | |
parent | cc7a533a087efcf492ea50c0d9f4d7b337e492e0 (diff) |
patch [#36407] Triangle strip support in PLY file importer
from Eric Saari (esaari1)
Diffstat (limited to 'io_mesh_ply')
-rw-r--r-- | io_mesh_ply/import_ply.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index 6c80a390..a59c94d6 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'])) |