Skip to content
Snippets Groups Projects
Commit aa45f265 authored by Campbell Barton's avatar Campbell Barton
Browse files

patch [#36407] Triangle strip support in PLY file importer

from Eric Saari (esaari1)
parent cc7a533a
No related branches found
No related tags found
No related merge requests found
...@@ -243,6 +243,8 @@ def load_ply_mesh(filepath, ply_name): ...@@ -243,6 +243,8 @@ def load_ply_mesh(filepath, ply_name):
elif el.name == b'face': elif el.name == b'face':
findex = el.index(b'vertex_indices') findex = el.index(b'vertex_indices')
elif el.name == b'tristrips':
trindex = el.index(b'vertex_indices')
mesh_faces = [] mesh_faces = []
mesh_uvs = [] mesh_uvs = []
...@@ -286,6 +288,13 @@ def load_ply_mesh(filepath, ply_name): ...@@ -286,6 +288,13 @@ def load_ply_mesh(filepath, ply_name):
for j in range(len_ind - 2): for j in range(len_ind - 2):
add_face(verts, (ind[0], ind[j + 1], ind[j + 2]), uvindices, colindices) 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 = bpy.data.meshes.new(name=ply_name)
mesh.vertices.add(len(obj[b'vertex'])) mesh.vertices.add(len(obj[b'vertex']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment