From 6448cdbc2eacaf216cc49ff1f07992d1ced6f76e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Mar 2017 12:22:35 +1100 Subject: Cleanup: minor edits to 3ds import Use slots for chunk class, no need to use struct module for reading strings. --- io_scene_3ds/import_3ds.py | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'io_scene_3ds') diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index 745dd433..862fe2a7 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -19,7 +19,8 @@ # # Script copyright (C) Bob Holcomb -# Contributors: Bob Holcomb, Richard L?rk?ng, Damien McGinnes, Campbell Barton, Mario Lapin, Dominique Lorre, Andreas Atteneder +# Contributors: Bob Holcomb, Richard L?rk?ng, Damien McGinnes, +# Campbell Barton, Mario Lapin, Dominique Lorre, Andreas Atteneder import os import time @@ -155,13 +156,13 @@ object_dictionary = {} object_matrix = {} -#the chunk class -class chunk: - ID = 0 - length = 0 - bytes_read = 0 - - #we don't read in the bytes_read, we compute that +class Chunk: + __slots__ = ( + "ID", + "length", + "bytes_read", + ) + # we don't read in the bytes_read, we compute that binary_format = "