diff --git a/NinjaModel.py b/NinjaModel.py index d4a515d..b1a1c56 100644 --- a/NinjaModel.py +++ b/NinjaModel.py @@ -78,7 +78,6 @@ class NinjaModel: # { # } - print(self.vertex_list) return None # } @@ -197,14 +196,25 @@ class NinjaModel: # { bytes = self.file.read(24) v = struct.unpack('ffffff', bytes) - pos = [ v[0], v[1], v[2] ] - norm = [ v[3], v[4], v[5] ] - self.bone.apply(pos) + vertex = { + 'pos' : [ v[0], v[1], v[2] ], + 'norm' : [ v[3], v[4], v[5] ] + } + self.bone.apply(vertex['pos']) self.index_lookup[vertex_ofs] = len(self.vertex_list) - self.vertex_list.append({ - 'pos' : pos, - 'norm' : norm - }) + self.vertex_list.append(vertex) + + pos = self.file.tell() + bytes = self.file.read(2) + c = struct.unpack('BB', bytes) + chunk_head = c[0] + chunk_flag = c[1] + + if chunk_head != 255: + print("ERROR ANOTHER VERTEX LIST DETECTED") + + print("End Chunk Head: %d" % chunk_head) + print("End Chunk Flag: %d" % chunk_flag) return None