def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_uint16(len(self.transforms)) for transform in self.transforms: transform.write(dg) dg.add_uint16(len(self.vertex_morphs)) for morph in self.vertex_morphs: morph.write(dg) dg.add_uint16(len(self.normal_morphs)) for morph in self.normal_morphs: morph.write(dg) dg.add_uint16(len(self.texcoord_morphs)) for morph in self.texcoord_morphs: morph.write(dg) dg.add_uint16(len(self.color_morphs)) for morph in self.color_morphs: morph.write(dg) write_vec_arr(dg, self.orig_coords) write_vec_arr(dg, self.orig_norms) write_vec_arr(dg, self.orig_colors) write_vec_arr(dg, self.orig_texcoords)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) self.bam_file.write_pointer(dg, self.egg_file_id) dg.add_string(self.tref_name) self.tex_mat.write(write_version, dg) self.inv_tex_mat.write(write_version, dg) self.bam_file.write_pointer(dg, self.source_texture_id) self.bam_file.write_pointer(dg, self.placement_id) dg.add_bool(self.uses_alpha) dg.add_bool(self.any_uvs) for uv in self.min_uv: dg.add_float64(uv) for uv in self.max_uv: dg.add_float64(uv) dg.add_int32(self.wrap_u) dg.add_int32(self.wrap_v) self.properties.write(write_version, dg)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_bool(self.got_num_channels) dg.add_int32(self.num_channels) if PI_VERSION >= 9: dg.add_int32(self.effective_channels) dg.add_int32(self.format) dg.add_bool(self.force_format) if PI_VERSION >= 9: dg.add_bool(self.generic_format) if PI_VERSION >= 13: dg.add_bool(self.keep_format) dg.add_int32(self.minfilter) dg.add_int32(self.magfilter) if PI_VERSION >= 18: dg.add_int32(self.quality_level) dg.add_int32(self.anisotropic_degree) self.bam_file.write_pointer(dg, self.color_type_id) self.bam_file.write_pointer(dg, self.alpha_type_id)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_string(self.name) self.bam_file.write_pointer(dg, self.group_id) self.texture_properties.write(write_version, dg) self.bam_file.write_pointer_uint32_list(dg, self.image_ids)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) self.properties.write(write_version, dg) dg.add_string(self.filename) dg.add_string(self.alpha_filename) if PI_VERSION >= 10: dg.add_uint8(self.alpha_file_channel) dg.add_bool(self.size_known) dg.add_int32(self.x_size) dg.add_int32(self.y_size)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_string(self.name) dg.add_string(self.filename) dg.add_string(self.alpha_filename) if write_version >= (4, 2): dg.add_uint8(self.primary_file_num_channels) if write_version >= (4, 3): dg.add_uint8(self.alpha_file_channel) dg.append_data(self.texture_data)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_string(self.name) dg.add_string(self.dirname) self.palette_groups.write(write_version, dg) dg.add_int32(self.dependency_level) dg.add_int32(self.dependency_order) dg.add_int32(self.dirname_order) self.bam_file.write_pointer_uint32_list(dg, self.placement_ids) self.bam_file.write_pointer_uint32_list(dg, self.page_ids) if PI_VERSION >= 19: dg.add_bool(self.has_margin_override) dg.add_int16(self.margin_override)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_int32(self.margin) dg.add_int32(self.x) dg.add_int32(self.y) dg.add_int32(self.x_size) dg.add_int32(self.y_size) for uv in self.min_uv: dg.add_float64(uv) for uv in self.max_uv: dg.add_float64(uv) dg.add_int32(self.wrap_u) dg.add_int32(self.wrap_v)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) write_vec_arr(dg, self.coords) write_vec_arr(dg, self.norms) write_vec_arr(dg, self.colors) write_vec_arr(dg, self.texcoords) write_ushort_arr(dg, self.vindex) write_ushort_arr(dg, self.nindex) write_ushort_arr(dg, self.cindex) write_ushort_arr(dg, self.tindex) dg.add_uint16(self.num_prims) write_int_arr(dg, self.prim_lengths) for bind in self.binds: dg.add_uint8(bind)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) self.bam_file.write_pointer(dg, self.texture_id) self.bam_file.write_pointer(dg, self.group_id) self.bam_file.write_pointer(dg, self.image_id) self.bam_file.write_pointer(dg, self.dest_image_id) dg.add_bool(self.has_uvs) dg.add_bool(self.size_known) self.position.write(write_version, dg) dg.add_bool(self.is_filled) self.placed.write(write_version, dg) dg.add_int32(self.omit_reason) self.bam_file.write_pointer_int32_list(dg, self.reference_ids) self.bam_file.write_pointer_int32_list(dg, self.texture_swap_ids)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_string(self.name) dg.add_string(self.alpha_name)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) self.bam_file.write_pointer_int32_list(dg, self.group_ids)
def write(self, write_version, dg): BamObject.write(self, write_version, dg) dg.add_uint8(int(self.tangible))