diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-30 04:27:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-30 04:27:39 +0300 |
commit | db61a1b25a8d1c4097de54dda588ae45f64e9cf5 (patch) | |
tree | c051ab93b38241c868b89e388d3de131e713d312 /io_mesh_ply | |
parent | 05be1c09a5c5e8fdc496591aaccecc9d49049653 (diff) |
Fix version check for PLY
Some programs wrote extra trailing zeros.
Alternate fix to D2692.
Diffstat (limited to 'io_mesh_ply')
-rw-r--r-- | io_mesh_ply/import_ply.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index 76e5ff1e..eb097ba9 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -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: |