Exemplo n.º 1
0
 def read_mdx(self, stream: BinaryStream, version):
     size = stream.read_uint32()
     self.alpha = stream.read_float32()
     self.flags = stream.read_uint32()
     self.color = stream.read_float32_array(3)
     self.geoset_id = stream.read_int32()
     self.read_animations(stream, size - 28)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
 def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.type = stream.read_uint32()
     self.attenuation = stream.read_float32_array(2)
     self.color = stream.read_float32_array(3)
     self.intensity = stream.read_float32()
     self.ambient_color = stream.read_float32_array(3)
     self.ambient_intensity = stream.read_float32()
     self.read_animations(stream, size - (stream.index - start))
 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))
Exemplo n.º 7
0
 def read_mdx(self, stream: BinaryStream, version: int):
     start = stream.index
     size = stream.read_uint32()
     self.filter_mode = stream.read_uint32()
     self.flags = stream.read_uint32()
     self.texture_id = stream.read_int32()
     self.texture_animation_id = stream.read_int32()
     self.coord_id = stream.read_uint32()
     self.alpha = stream.read_float32()
     if version > 800:
         self.emissive_gain = stream.read_float32()
         self.fresnel_color = stream.read_float32_array(3)
         self.fresnel_opacity = stream.read_float32()
         self.fresnel_team_color = stream.read_float32()
     self.read_animations(stream, size - (stream.index - start))
Exemplo n.º 8
0
 def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.height_above = stream.read_float32()
     self.height_below = stream.read_float32()
     self.alpha = stream.read_float32()
     self.color = stream.read_float32_array(3)
     self.lifespan = stream.read_float32()
     self.texture_slot = stream.read_uint32()
     self.emission_rate = stream.read_uint32()
     self.rows = stream.read_uint32()
     self.columns = stream.read_uint32()
     self.material_id = stream.read_int32()
     self.gravity = stream.read_float32()
     self.read_animations(stream, size - (stream.index - start))
Exemplo n.º 9
0
 def read_mdx(self, stream: BinaryStream, name: str):
     frames = self.frames
     values = self.values
     in_tans = self.in_tans
     out_tans = self.out_tans
     tracks_count = stream.read_uint32()
     interpolation_type = stream.read_uint32()
     self.name = name
     self.interpolation_type = interpolation_type
     self.global_sequence_id = stream.read_int32()
     for i in range(tracks_count):
         frames.append(stream.read_int32())
         values.append(self.read_mdx_value(stream))
         if interpolation_type > 1:
             in_tans.append(self.read_mdx_value(stream))
             out_tans.append(self.read_mdx_value(stream))
Exemplo n.º 10
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))
Exemplo n.º 11
0
 def read_mdx(self, stream: BinaryStream, version):
     super().read_mdx(stream, version)
     self.type = stream.read_uint32()
     self.vertices[0] = stream.read_float32_array(3)
     if self.type != 2:
         self.vertices[1] = stream.read_float32_array(3)
     if self.type == 2 or self.type == 3:
         self.bounds_radius = stream.read_float32()
Exemplo n.º 12
0
 def read_mdx(self, stream: BinaryStream, version):
     start = stream.index
     size = stream.read_uint32()
     super().read_mdx(stream, version)
     self.speed = stream.read_float32()
     self.variation = stream.read_float32()
     self.latitude = stream.read_float32()
     self.gravity = stream.read_float32()
     self.life_span = stream.read_float32()
     self.emission_rate = stream.read_float32()
     self.width = stream.read_float32()
     self.length = stream.read_float32()
     self.filter_mode = stream.read_uint32()
     self.rows = stream.read_uint32()
     self.columns = stream.read_uint32()
     self.head_or_tail = stream.read_uint32()
     self.tail_length = stream.read_float32()
     self.time_middle = stream.read_float32()
     self.segment_colors[0] = stream.read_float32_array(3)
     self.segment_colors[1] = stream.read_float32_array(3)
     self.segment_colors[2] = stream.read_float32_array(3)
     self.segment_alphas = stream.read_uint8_array(3)
     self.segment_scaling = stream.read_float32_array(3)
     self.head_intervals[0] = stream.read_uint32_array(3)
     self.head_intervals[1] = stream.read_uint32_array(3)
     self.tail_intervals[0] = stream.read_uint32_array(3)
     self.tail_intervals[1] = stream.read_uint32_array(3)
     self.texture_id = stream.read_int32()
     self.squirt = stream.read_uint32()
     self.priority_plane = stream.read_int32()
     self.replaceable_id = stream.read_uint32()
     self.read_animations(stream, size - (stream.index - start))
Exemplo n.º 13
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)
Exemplo n.º 14
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))
Exemplo n.º 15
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))
Exemplo n.º 16
0
 def load_global_sequence_chunk(self, stream: BinaryStream, size: int):
     l = int(size / 4)
     i = 0
     while i < l:
         self.global_sequences.append(stream.read_uint32())
         i += 1
Exemplo n.º 17
0
 def read_mdx(self, stream: BinaryStream):
     self.replaceable_id = stream.read_uint32()
     self.path = stream.read(260)
     self.flags = stream.read_uint32()
Exemplo n.º 18
0
 def read_mdx(self, stream: BinaryStream):
     size = stream.read_uint32()
     self.read_animations(stream, size - 4)
Exemplo n.º 19
0
 def load_bind_pose_chunk(self, stream: BinaryStream, size: int):
     for i in range(stream.read_uint32()):
         self.bind_pose.append(stream.read_float32_array(12))
Exemplo n.º 20
0
 def read_mdx(self, stream: BinaryStream, version):
     super().read_mdx(stream, version)
     stream.skip(4)  # KEVT TAG
     count = stream.read_uint32()
     self.global_sequence_id = stream.read_int32()
     self.tracks = stream.read_uint32_array(count)
Exemplo n.º 21
0
 def read_mdx_value(self, stream: BinaryStream) -> tuple:
     self.byte_value = 4
     return stream.read_uint32()