def read(self, reader: ByteIO): entry = reader.tell() self.name_offset = reader.read_int32() self.name = reader.read_from_offset(entry + self.name_offset, reader.read_ascii_string) entry = reader.tell() self.value_offset = reader.read_int32() self.value = reader.read_from_offset(entry + self.value_offset, reader.read_ascii_string)
def read(self, reader: ByteIO): entry = reader.tell() self.content_relative_filename_offset = reader.read_int32() self.content_relative_filename = reader.read_from_offset(entry + self.content_relative_filename_offset, reader.read_ascii_string) entry = reader.tell() self.content_search_path_offset = reader.read_int32() self.content_search_path = reader.read_from_offset(entry + self.content_search_path_offset, reader.read_ascii_string)
def read(self, reader: ByteIO): entry = reader.tell() self.string_offset = reader.read_int32() self.string = reader.read_from_offset(entry + self.string_offset, reader.read_ascii_string) entry = reader.tell() self.compiler_identifier_offset = reader.read_int32() self.compiler_identifier = reader.read_from_offset(entry + self.compiler_identifier_offset, reader.read_ascii_string) self.fingerprint = reader.read_uint32() self.user_data = reader.read_uint32()
def read(self, reader: ByteIO): entry = reader.tell() self.parameter_name_offset = reader.read_int32() self.parameter_name = reader.read_from_offset(entry + self.parameter_name_offset, reader.read_ascii_string) entry = reader.tell() self.parameter_type_offset = reader.read_int32() self.parameter_type = reader.read_from_offset(entry + self.parameter_type_offset, reader.read_ascii_string) self.fingerprint = reader.read_uint32() self.fingerprint_default = reader.read_uint32()
def read(self, reader: ByteIO): self.r_id = reader.read_int64() entry = reader.tell() self.resource_name_offset = reader.read_int64() if self.resource_name_offset: self.resource_name = reader.read_from_offset( entry + self.resource_name_offset, reader.read_ascii_string)
def read(self, reader: ByteIO): entry = reader.tell() self.material_id = reader.read_int16() self.replacement_material_name_offset = reader.read_int32() self.replacement_material_name = reader.read_from_offset(self.replacement_material_name_offset, reader.read_ascii_string) return self
def read(self, reader: ByteIO): entry = reader.tell() self.nameOffset = reader.read_uint32() self.thePathFileName = reader.read_from_offset( entry + self.nameOffset, reader.read_ascii_string) self.flags = reader.read_uint32() self.used = reader.read_uint32() self.unused1 = reader.read_uint32() self.materialP = reader.read_uint32() self.clientMaterialP = reader.read_uint32() self.unused = [reader.read_uint32() for _ in range(5)]
def read(self,reader:ByteIO): entry = reader.tell() self.cycle = reader.read_float() self.eventIndex = reader.read_uint32() self.eventType = reader.read_uint32() self.options = [reader.read_uint8() for _ in range(64)] self.nameOffset = reader.read_uint32() if self.nameOffset: self.theName = reader.read_from_offset(self.nameOffset+entry,reader.read_ascii_string) else: self.theName = str(self.eventIndex) return self
def read(self, reader: ByteIO, MDL: SourceMdlFileData): entry = reader.tell() self.entry = entry self.baseHeaderOffset = reader.read_int32() self.nameOffset = reader.read_int32() self.theName = reader.read_from_offset(entry + self.nameOffset, reader.read_ascii_string) self.fps = reader.read_float() self.flags = self.STUDIO(reader.read_uint32()) self.frameCount = reader.read_uint32() self.movementCount = reader.read_uint32() self.movementOffset = reader.read_uint32() self.unused1 = [reader.read_uint32() for _ in range(6)] self.animBlock = reader.read_uint32() self.animOffset = reader.read_uint32() self.ikRuleCount = reader.read_uint32() self.ikRuleOffset = reader.read_uint32() self.animblockIkRuleOffset = reader.read_uint32() self.localHierarchyCount = reader.read_uint32() self.localHierarchyOffset = reader.read_uint32() self.sectionOffset = reader.read_uint32() self.sectionFrameCount = reader.read_uint32() self.spanFrameCount = reader.read_uint16() self.spanCount = reader.read_uint16() self.spanOffset = reader.read_uint32() self.spanStallTime = reader.read_float() self.fileOffsetStart2 = entry + self.spanOffset self.fileOffsetEnd2 = entry + self.spanOffset-1 if self.spanFrameCount!=0 or self.spanCount!=0 or self.spanOffset!=0 or self.spanStallTime!=0: for bone_index in range(len(MDL.bones)): bone = MDL.bones[bone_index] #type: SourceMdlBone if bone.flags & SourceMdlBone.BONE_HAS_SAVEFRAME_POS: self.fileOffsetEnd2 += self.spanCount * 6 if bone.flags & SourceMdlBone.BONE_HAS_SAVEFRAME_ROT: self.fileOffsetEnd2 += self.spanCount * 8 return self
def read(self, reader: ByteIO): self.introspection_version = reader.read_int32() self.s_id = reader.read_int32() entry = reader.tell() self.name_offset = reader.read_int32() self.name = reader.read_from_offset(entry + self.name_offset, reader.read_ascii_string) self.disc_crc = reader.read_int32() self.user_version = reader.read_uint32() entry = reader.tell() self.field_offset = reader.read_int32() self.field_count = reader.read_int32() with reader.save_current_pos(): if self.field_count > 0: reader.seek(entry + self.field_offset) for n in range(self.field_count): field = NTROEnumField(self) field.read(reader) self.fields.append(field)
def read(self, reader: ByteIO, block_info: InfoBlock = None): self.info_block = block_info entry = reader.tell() self.name_offset = reader.read_int32() self.name = reader.read_from_offset(entry + self.name_offset, reader.read_ascii_string) self.count = reader.read_int16() self.on_disc_size = reader.read_int16() entry = reader.tell() self.indirection_bytes_offset = reader.read_int32() self.indirection_level = reader.read_int32() with reader.save_current_pos(): reader.seek(entry + self.indirection_bytes_offset) indir_level = self.indirection_level if self.indirection_level < 10 else 10 for _ in range(indir_level): self.indirection_bytes.append(reader.read_int8()) self.data_type = reader.read_int32() self.type = KeyValueDataType(reader.read_int16()) reader.skip(2)
def read(self,reader:ByteIO,mdl:SourceMdlFileData): entry = reader.tell() self.baseHeaderOffset = reader.read_int32() self.nameOffset = reader.read_uint32() self.theName = reader.read_from_offset(entry+self.nameOffset,reader.read_ascii_string) self.activityNameOffset = reader.read_uint32() self.theActivityName = reader.read_from_offset(entry+self.activityNameOffset,reader.read_ascii_string) self.flags = reader.read_uint32() self.activity = reader.read_int32() self.activityWeight = reader.read_uint32() self.eventCount = reader.read_uint32() self.eventOffset = reader.read_uint32() self.bbMin.read(reader) self.bbMax.read(reader) self.blendCount = reader.read_uint32() self.animIndexOffset = reader.read_uint32() self.movementIndex = reader.read_uint32() self.groupSize = [reader.read_uint32() for _ in range(2)] self.paramIndex = [reader.read_int32() for _ in range(2)] self.paramStart = [reader.read_uint32() for _ in range(2)] self.paramEnd = [reader.read_uint32() for _ in range(2)] self.paramParent = reader.read_uint32() self.fadeInTime = reader.read_float() self.fadeOutTime = reader.read_float() self.localEntryNodeIndex = reader.read_uint32() self.localExitNodeIndex = reader.read_uint32() self.nodeFlags = reader.read_uint32() self.entryPhase = reader.read_float() self.exitPhase = reader.read_float() self.lastFrame = reader.read_float() self.nextSeq = reader.read_uint32() self.pose = reader.read_uint32() self.ikRuleCount = reader.read_uint32() self.autoLayerCount = reader.read_uint32() self.autoLayerOffset = reader.read_uint32() self.weightOffset = reader.read_uint32() self.poseKeyOffset = reader.read_uint32() self.ikLockCount = reader.read_uint32() self.ikLockOffset = reader.read_uint32() self.keyValueOffset = reader.read_uint32() self.keyValueSize = reader.read_uint32() self.cyclePoseIndex = reader.read_uint32() if mdl.version == 49: self.activityModifierOffset = reader.read_int32() self.activityModifierCount = reader.read_uint32() self.unused = [reader.read_uint32() for _ in range(5)] else: self.unused = [reader.read_uint32() for _ in range(7)] if self.groupSize[0] > 1 and self.groupSize[1] > 1 and self.poseKeyOffset !=0: with reader.save_current_pos(): reader.seek(entry+self.poseKeyOffset) for _ in range(self.groupSize[0]+self.groupSize[1]): self.thePoseKeys.append(reader.read_float()) if self.eventCount > 0 and self.eventOffset!=0: with reader.save_current_pos(): reader.seek(entry+self.eventOffset) for _ in range(self.eventCount): self.theEvents.append(SourceMdlEvent().read(reader)) return self