1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2025-02-23 20:32:59 +01:00

Fix for issue #32.

Unrecognized sections are now simply ignored.
This commit is contained in:
Colin Basnett 2023-04-03 01:52:52 -07:00
parent f40db53cb9
commit 947c86eb8f

View File

@ -1,4 +1,5 @@
import ctypes import ctypes
import os
from .data import * from .data import *
@ -46,5 +47,7 @@ def read_psk(path: str) -> Psk:
elif section.name == b'VTXNORMS': elif section.name == b'VTXNORMS':
_read_types(fp, Vector3, section, psk.vertex_normals) _read_types(fp, Vector3, section, psk.vertex_normals)
else: else:
raise RuntimeError(f'Unrecognized section "{section.name} at position {15:fp.tell()}"') # Section is not handled, skip it.
fp.seek(section.data_size * section.data_count, os.SEEK_CUR)
print(f'Unrecognized section "{section.name} at position {fp.tell():15}"')
return psk return psk