fix for lightwave object loader
This commit is contained in:
@@ -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
|
# ima, IMAG, g_IMAG refers to clip dictionary 'ID' entries: refer to blok and surf
|
||||||
clip_dict = {}
|
clip_dict = {}
|
||||||
data = cStringIO.StringIO(lwochunk.read())
|
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
|
clip_dict['ID'] = image_index
|
||||||
i = 4
|
i = 4
|
||||||
while(i < lwochunk.chunksize):
|
while(i < lwochunk.chunksize):
|
||||||
@@ -1634,11 +1639,11 @@ def main():
|
|||||||
return
|
return
|
||||||
|
|
||||||
Blender.Window.FileSelector(read, "Import LWO", '*.lwo')
|
Blender.Window.FileSelector(read, "Import LWO", '*.lwo')
|
||||||
|
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
# Cams debugging lwo loader
|
# Cams debugging lwo loader
|
||||||
"""
|
"""
|
||||||
TIME= Blender.sys.time()
|
TIME= Blender.sys.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user