Exemple #1
0
class TextureHeader(bt.Struct(
  bt.Field(bt.uint8,'format'),
  bt.Padding(1,b'\x00'),
  bt.Field(bt.uint16,'width'),
  bt.Field(bt.uint16,'height'),
  bt.Padding(26,b'\x00'))): pass


class TexObj(bt.Struct(
Exemple #2
0
class TexObj(bt.Struct(
  bt.Field(bt.uint16,'texture_index'),
  bt.Padding(2),
  bt.Field(bt.uint8,'unknown1'), # unknown1 in (0,1,2)
  bt.Field(bt.uint8,'unknown2'), # unknown2 in (0,1,2)
  bt.Field(bt.uint8,'unknown3'), # unknown3 in (0,1,4)
  bt.Padding(1,b'\x00'))): pass


class TevStage(bt.Struct(
Exemple #3
0
class Material(bt.Struct(
  bt.Field(Color,'color'),
  bt.Field(bt.uint16,'unknown1'), # unknown1 in (0,1), number of colors?
  bt.Field(bt.uint8,'unknown2'), # unknown2 in (0,1,2,4)
  bt.Field(bt.uint8,'num_tev_stages'), # unknown3 in (0,1,2)
  bt.Field(bt.uint8,'unknown4'), # unknown4 in (0,1)
  bt.Padding(23,b'\x00'),
  bt.Field(bt.Array(TevStage,8),'tev_stages'))): pass


class Shape(bt.Struct(
Exemple #4
0
class Node(bt.Struct(
  bt.Field(bt.uint16,'unknown0'),
  bt.Field(bt.uint16,'unknown1'), # unknown1 in (0,1)
  bt.Field(bt.uint16,'unknown2'),
  bt.Field(bt.uint16,'unknown3'), # unknown3 in (0,1)
  bt.Field(bt.uint16,'unknown4'),
  bt.Field(bt.uint16,'unknown5'),
  bt.Padding(4,b'\x00'))): pass


class TextureHeader(bt.Struct(
Exemple #5
0
class Header(bt.Struct(
  bt.Field(bt.uint32,'magic'), # magic == 0x04B40000
  bt.Field(bt.uint16,'num_faces'),
  bt.Padding(2,b'\x00'),
  bt.Field(bt.uint16,'num_nodes'), # num_nodes == num_joints
  bt.Field(bt.uint16,'num_shape_packets'),
  bt.Field(bt.uint16,'num_weighted_matrices'),
  bt.Field(bt.uint16,'num_joints'),
  bt.Field(bt.uint16,'num_vertices'),
  bt.Field(bt.uint16,'num_normals'),
  bt.Field(bt.uint16,'num_colors'),
  bt.Field(bt.uint16,'num_texcoords'),
  bt.Padding(8,b'\x00'),
  bt.Field(bt.uint16,'num_textures'),
  bt.Padding(2,b'\x00'),
  bt.Field(bt.uint16,'num_texobjs'),
  bt.Field(bt.uint16,'num_draw_elements'), # num_draw_elements == num_shapes
  bt.Field(bt.uint16,'num_materials'),
  bt.Field(bt.uint16,'num_shapes'),
  bt.Padding(4,b'\x00'),
  bt.Field(bt.uint32,'node_offset'),
  bt.Field(bt.uint32,'shape_packet_offset'),
  bt.Field(bt.uint32,'matrix_offset'),
  bt.Field(bt.uint32,'weight_offset'),
  bt.Field(bt.uint32,'joint_index_offset'),
  bt.Field(bt.uint32,'num_weights_offset'),
  bt.Field(bt.uint32,'vertex_offset'),
  bt.Field(bt.uint32,'normal_offset'),
  bt.Field(bt.uint32,'color_offset'),
  bt.Field(bt.uint32,'texcoord_offset'),
  bt.Padding(8,b'\x00'),
  bt.Field(bt.uint32,'texture_location_offset'),
  bt.Padding(4,b'\x00'),
  bt.Field(bt.uint32,'material_offset'),
  bt.Field(bt.uint32,'texobj_offset'),
  bt.Field(bt.uint32,'shape_offset'),
  bt.Field(bt.uint32,'draw_element_offset'),
  bt.Padding(8,b'\x00'))): pass


class Vector(bt.Struct(