public override void Read(string filename) { FileData file = new FileData(filename); if (file != null) { file.Endian = Endianness.Little; Endian = Endianness.Little; string magic = file.readString(0, 4); if (magic == "VBN ") { file.Endian = Endianness.Big; Endian = Endianness.Big; } file.seek(4); unk_1 = (short)file.readShort(); unk_2 = (short)file.readShort(); totalBoneCount = (UInt32)file.readInt(); boneCountPerType[0] = (UInt32)file.readInt(); boneCountPerType[1] = (UInt32)file.readInt(); boneCountPerType[2] = (UInt32)file.readInt(); boneCountPerType[3] = (UInt32)file.readInt(); int[] pi = new int[totalBoneCount]; for (int i = 0; i < totalBoneCount; i++) { Bone temp = new Bone(this); temp.Text = file.readString(file.pos(), -1); file.skip(64); temp.boneType = (UInt32)file.readInt(); pi[i] = file.readInt(); temp.boneId = (UInt32)file.readInt(); temp.position = new float[3]; temp.rotation = new float[3]; temp.scale = new float[3]; bones.Add(temp); } for (int i = 0; i < bones.Count; i++) { bones[i].position[0] = file.readFloat(); bones[i].position[1] = file.readFloat(); bones[i].position[2] = file.readFloat(); bones[i].rotation[0] = file.readFloat(); bones[i].rotation[1] = file.readFloat(); bones[i].rotation[2] = file.readFloat(); bones[i].scale[0] = file.readFloat(); bones[i].scale[1] = file.readFloat(); bones[i].scale[2] = file.readFloat(); Bone temp = bones[i]; temp.parentIndex = pi[i]; //Debug.Write(temp.parentIndex); //if (temp.parentIndex != 0x0FFFFFFF && temp.parentIndex > -1) // bones[temp.parentIndex].children.Add(i); bones[i] = temp; } reset(); } }