def write_mdx(self, stream: BinaryStream, version): stream.write_uint32(self.get_byte_length()) super().write_mdx(stream, version) stream.write_float32(self.speed) stream.write_float32(self.variation) stream.write_float32(self.latitude) stream.write_float32(self.gravity) stream.write_float32(self.life_span) stream.write_float32(self.emission_rate) stream.write_float32(self.width) stream.write_float32(self.length) stream.write_uint32(self.filter_mode) stream.write_uint32(self.rows) stream.write_uint32(self.columns) stream.write_uint32(self.head_or_tail) stream.write_float32(self.tail_length) stream.write_float32(self.time_middle) stream.write_float32_array(self.segment_colors[0]) stream.write_float32_array(self.segment_colors[1]) stream.write_float32_array(self.segment_colors[2]) stream.write_uint8_array(self.segment_alphas) stream.write_float32_array(self.segment_scaling) stream.write_uint32_array(self.head_intervals[0]) stream.write_uint32_array(self.head_intervals[1]) stream.write_uint32_array(self.tail_intervals[0]) stream.write_uint32_array(self.tail_intervals[1]) stream.write_int32(self.texture_id) stream.write_uint32(self.squirt) stream.write_int32(self.priority_plane) stream.write_uint32(self.replaceable_id) self.write_non_generic_animation_chunks(stream)
def write_mdx(self, stream: BinaryStream, version: int): stream.write_uint32(self.get_byte_length(version)) stream.write('VRTX') stream.write_uint32(len(self.vertices) // 3) stream.write_float32_array(self.vertices) stream.write('NRMS') stream.write_uint32(len(self.normals) // 3) stream.write_float32_array(self.normals) stream.write('PTYP') stream.write_uint32(len(self.face_type_groups)) stream.write_uint32_array(self.face_type_groups) stream.write('PCNT') stream.write_uint32(len(self.face_groups)) stream.write_uint32_array(self.face_groups) stream.write('PVTX') stream.write_uint32(len(self.faces)) stream.write_uint16_array(self.faces) stream.write('GNDX') stream.write_uint32(len(self.vertex_groups)) stream.write_uint8_array(self.vertex_groups) stream.write('MTGC') stream.write_uint32(len(self.matrix_groups)) stream.write_uint32_array(self.matrix_groups) stream.write('MATS') stream.write_uint32(len(self.matrix_indices)) stream.write_uint32_array(self.matrix_indices) stream.write_uint32(self.material_id) stream.write_uint32(self.selection_group) stream.write_uint32(self.selection_flags) if version > 800: stream.write_int32(self.lod) stream.write(self.lod_name) stream.skip(80 - len(self.lod_name)) self.extent.write_mdx(stream) stream.write_uint32(len(self.sequence_extents)) for sequence_extent in self.sequence_extents: sequence_extent.write_mdx(stream) if version > 800: if len(self.tangents): stream.write('TANG') stream.write_uint32(len(self.tangents) // 4) stream.write_float32_array(self.tangents) if len(self.skin): stream.write('SKIN') stream.write_uint32(len(self.skin)) stream.write_uint8_array(self.skin) stream.write('UVAS') stream.write_uint32(len(self.uv_sets)) for uv_set in self.uv_sets: stream.write('UVBS') stream.write_uint32(len(uv_set) // 2) stream.write_float32_array(uv_set)
def write_mdx(self, stream: BinaryStream): stream.write(self.tag) stream.write_uint32(len(self.chunk)) stream.write_uint8_array(self.chunk)