vlist detect

This commit is contained in:
Benjamin Collins 2020-08-11 08:51:52 +09:00
parent fda484aa1a
commit 97dad90ee5

View File

@ -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