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))
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()
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)
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): 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)
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))
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))
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))
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))
def read_mdx_value(self, stream: BinaryStream) -> tuple: self.byte_value = 16 return stream.read_float32_array(4)
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))
def load_pivot_point_chunk(self, stream: BinaryStream, size: int): for i in range(int(size / 12)): self.pivot_points.append(stream.read_float32_array(3))
def read_mdx(self, stream: BinaryStream): self.bounds_radius = stream.read_float32() self.min = stream.read_float32_array(3) self.max = stream.read_float32_array(3)