diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-01-24 23:31:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-01-24 23:31:11 +0300 |
commit | 04512c7306c73e6dfce037562f74733d94e777f7 (patch) | |
tree | 7f7324adb8476388f832d2f47ec7240a67d3de31 /release | |
parent | 450b3664e1592a2b17491b6b229d8e6808ac8ee4 (diff) |
fix for lightwave object loader
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/lightwave_import.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/lightwave_import.py b/release/scripts/lightwave_import.py index 24e072f018a..b59d582d680 100644 --- a/release/scripts/lightwave_import.py +++ b/release/scripts/lightwave_import.py @@ -656,7 +656,12 @@ def read_clip(lwochunk, dir_part): # ima, IMAG, g_IMAG refers to clip dictionary 'ID' entries: refer to blok and surf clip_dict = {} data = cStringIO.StringIO(lwochunk.read()) - image_index, = struct.unpack(">L", data.read(4)) + data_str = data.read(4) + if len(data_str) < 4: # can be zero also??? :/ + # Should not happen but lw can import so we should too + return + + image_index, = struct.unpack(">L", ) clip_dict['ID'] = image_index i = 4 while(i < lwochunk.chunksize): @@ -1634,11 +1639,11 @@ def main(): return Blender.Window.FileSelector(read, "Import LWO", '*.lwo') - if __name__=='__main__': main() + # Cams debugging lwo loader """ TIME= Blender.sys.time() |