Skip to content

Commit

Permalink
Fix version check for PLY
Browse files Browse the repository at this point in the history
Some programs wrote extra trailing zeros.
Alternate fix to D2692.
  • Loading branch information
ideasman42 committed Jun 30, 2017
1 parent 05be1c0 commit db61a1b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion io_mesh_ply/import_ply.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,15 @@ def read(filepath):
if tokens[1] not in format_specs:
print('Unknown format', tokens[1])
return invalid_ply
if tokens[2] != version:
try:
version_test = float(tokens[2])
except Exception as ex:
print('Unknown version', ex)
version_test = None
if version_test != float(version):
print('Unknown version', tokens[2])
return invalid_ply
del version_test
format = tokens[1]
elif tokens[0] == b'element':
if len(tokens) < 3:
Expand Down

0 comments on commit db61a1b

Please sign in to comment.