public void Deserialize(Stream stream, MotHeader header, int boneEnd, bool bFMode) { stream.Position = header.InfoOffset; var serializer = new BinarySerializer(); Info = serializer.Deserialize <MotInfo>(stream); stream.Position = header.UnkDataOffset; while (stream.Position < header.DataOffset) { Settings.Add(DataStream.ReadUInt32(stream)); } for (var i = 0; i < MotFile.MaxData; ++i) { var flagCount = MotFile.FrameValueOffset.ContainsKey(i) ? MotFile.FrameValueOffset[i] : 0; var motion = MotData.Deserialize(stream, flagCount, bFMode); Data.Add(motion); } Skeleton = new MotSkeleton(Data); stream.Position = header.BoneOffset; Bones = new MotBones(); Bones.GetIds(stream, boneEnd); }
public MotFile() { Header = new MotHeader(); SubHeaders = new List <MotHeader>(); Animations = new List <MotAnim>(); }
public void Initilize() { Header = new MotHeader { InfoOffset = 32, UnkDataOffset = 36, DataOffset = 168 }; SubHeaders = new List <MotHeader> { new MotHeader() }; Animations = new List <MotAnim> { new MotAnim() }; }