def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.life_span = stream.read_float32()
     self.emission_rate = stream.read_float32()
     self.speed = stream.read_float32()
     self.color = stream.read_float32_array(3)
     self.alpha = stream.read_float32()
     self.replaceable_id = stream.read_uint32()
     self.path = stream.read(260)
     self.animation_visibility_guide = stream.read(260)
     self.read_animations(stream, size - (stream.index - start))
예제 #2
0
 def read_animations(self, stream: BinaryStream, size: int):
     end = stream.index + size
     while stream.index < end:
         name = stream.read(4)
         animation = animation_map[name][1]()
         animation.read_mdx(stream, name)
         self.animations.append(animation)
예제 #3
0
 def read_mdx(self, stream: BinaryStream, version):
     size = stream.read_uint32()
     self.name = stream.read(80)
     self.object_id = stream.read_int32()
     self.parent_id = stream.read_int32()
     self.flags = stream.read_uint32()
     self.read_animations(stream, size - 96)
예제 #4
0
 def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.path = stream.read(260)
     self.attachment_id = stream.read_int32()
     self.read_animations(stream, size - (stream.index - start))
예제 #5
0
 def read_mdx(self, stream: BinaryStream):
     self.name = stream.read(80)
     self.interval = stream.read_uint32_array(2)
     self.move_speed = stream.read_float32()
     self.flags = stream.read_uint32()
     self.rarity = stream.read_float32()
     self.sync_point = stream.read_uint32()
     self.extent.read_mdx(stream)
예제 #6
0
 def read_mdx(self, stream: BinaryStream, version):
     size = stream.read_uint32()
     self.name = stream.read(80)
     self.position = stream.read_float32_array(3)
     self.field_of_view = stream.read_float32()
     self.far_clipping_plane = stream.read_float32()
     self.near_clipping_plane = stream.read_float32()
     self.target_position = stream.read_float32_array(3)
     self.read_animations(stream, size - 120)
예제 #7
0
 def read_mdx(self, stream: BinaryStream, version: int):
     stream.read_uint32()
     self.priority_plane = stream.read_int32()
     self.flags = stream.read_uint32()
     if version > 800:
         self.shader = stream.read(80)
     stream.skip(4)  # LAYS
     for i in range(stream.read_uint32()):
         layer = Layer()
         layer.read_mdx(stream, version)
         self.layers.append(layer)
예제 #8
0
 def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.emission_rate = stream.read_float32()
     self.gravity = stream.read_float32()
     self.longitude = stream.read_float32()
     self.latitude = stream.read_float32()
     self.path = stream.read(260)
     self.life_span = stream.read_float32()
     self.speed = stream.read_float32()
     self.read_animations(stream, size - (stream.index - start))
예제 #9
0
 def read_mdx(self, stream: BinaryStream, version: int):
     stream.read_uint32()
     stream.skip(4)  # VRTX TAG
     self.vertices = stream.read_float32_array(stream.read_uint32() * 3)
     stream.skip(4)  # NRMS TAG
     self.normals = stream.read_float32_array(stream.read_uint32() * 3)
     stream.skip(4)  # PTYP TAG
     self.face_type_groups = stream.read_uint32_array(stream.read_uint32())
     stream.skip(4)  # PCNT TAG
     self.face_groups = stream.read_uint32_array(stream.read_uint32())
     stream.skip(4)  # PVTX TAG
     self.faces = stream.read_uint16_array(stream.read_uint32())
     stream.skip(4)  # GNDX TAG
     self.vertex_groups = stream.read_uint8_array(stream.read_uint32())
     stream.skip(4)  # MTGC TAG
     self.matrix_groups = stream.read_uint32_array(stream.read_uint32())
     stream.skip(4)  # MATS TAG
     self.matrix_indices = stream.read_uint32_array(stream.read_uint32())
     self.material_id = stream.read_uint32()
     self.selection_group = stream.read_uint32()
     self.selection_flags = stream.read_uint32()
     if version > 800:
         self.lod = stream.read_int32()
         self.lod_name = stream.read(80)
     self.extent.read_mdx(stream)
     for i in range(stream.read_uint32()):
         extent = Extent()
         extent.read_mdx(stream)
         self.sequence_extents.append(extent)
     if version > 800:
         if stream.peek(4) == 'TANG':
             stream.skip(4)
             self.tangents = stream.read_float32_array(
                 stream.read_uint32() * 4)
         if stream.peek(4) == 'SKIN':
             stream.skip(4)
             self.skin = stream.read_uint8_array(stream.read_uint32())
     stream.skip(4)
     for i in range(stream.read_uint32()):
         stream.skip(4)
         self.uv_sets.append(
             stream.read_float32_array(stream.read_uint32() * 2))
예제 #10
0
 def read_mdx(self, stream: BinaryStream):
     self.type = stream.read(80)
     self.path = stream.read(260)
예제 #11
0
 def read_mdx(self, stream: BinaryStream):
     self.replaceable_id = stream.read_uint32()
     self.path = stream.read(260)
     self.flags = stream.read_uint32()