public void SetAnimationClip(xaAnimationClip clip, string name, int start, int end, int next, double speed) { clip.Name = name; clip.Start = start; clip.End = end; clip.Next = next; clip.Speed = (float)speed; Changed = true; }
public void DeleteAnimationClip(xaAnimationClip clip) { clip.Name = String.Empty; clip.Start = 0; clip.End = 0; clip.Next = 0; clip.Speed = 0; xa.CreateUnknowns(clip); Changed = true; }
public static void CopyUnknowns(xaAnimationClip src, xaAnimationClip dest) { dest.Unknown1 = (byte[])src.Unknown1.Clone(); dest.Unknown2 = (byte[])src.Unknown2.Clone(); dest.Unknown3 = (byte[])src.Unknown3.Clone(); dest.Unknown4 = (byte[])src.Unknown4.Clone(); dest.Unknown5 = (byte[])src.Unknown5.Clone(); dest.Unknown6 = (byte[])src.Unknown6.Clone(); dest.Unknown7 = (byte[])src.Unknown7.Clone(); }
public static void CreateUnknowns(xaAnimationClip clip) { clip.Unknown1 = new byte[4]; clip.Unknown2 = new byte[1]; clip.Unknown3 = new byte[1]; clip.Unknown4 = new byte[1]; clip.Unknown5 = new byte[1]; clip.Unknown6 = new byte[4]; clip.Unknown7 = new byte[16]; }
public void CopyAnimationClip(xaAnimationClip clip, int position) { xaAnimationClip newClip = Parser.AnimationSection.ClipList[position]; newClip.Name = clip.Name; newClip.Start = clip.Start; newClip.End = clip.End; newClip.Next = clip.Next; newClip.Speed = clip.Speed; xa.CopyUnknowns(clip, newClip); Changed = true; }
public void SetAnimationClipUnknowns(int clipId, byte[] unknown1, byte[] unknown2, byte[] unknown3, byte[] unknown4, byte[] unknown5, byte[] unknown6, byte[] unknown7) { xaAnimationClip clip = Parser.AnimationSection.ClipList[clipId]; clip.Unknown1 = (byte[])unknown1.Clone(); clip.Unknown2 = (byte[])unknown2.Clone(); clip.Unknown3 = (byte[])unknown3.Clone(); clip.Unknown4 = (byte[])unknown4.Clone(); clip.Unknown5 = (byte[])unknown5.Clone(); clip.Unknown6 = (byte[])unknown6.Clone(); clip.Unknown7 = (byte[])unknown7.Clone(); Changed = true; }
protected xaAnimationSection ParseAnimationSection() { if (reader.ReadByte() == 0) { return(null); } xaAnimationSection section = new xaAnimationSection(); int numClips; if (Format == 0x03) { numClips = 1024; } else { numClips = 512; } section.ClipList = new List <xaAnimationClip>(numClips); for (int i = 0; i < numClips; i++) { xaAnimationClip clip = new xaAnimationClip(); section.ClipList.Add(clip); clip.Name = reader.ReadName(64); clip.Speed = reader.ReadSingle(); clip.Unknown1 = reader.ReadBytes(4); clip.Start = reader.ReadSingle(); clip.End = reader.ReadSingle(); clip.Unknown2 = reader.ReadBytes(1); clip.Unknown3 = reader.ReadBytes(1); clip.Unknown4 = reader.ReadBytes(1); clip.Next = reader.ReadInt32(); clip.Unknown5 = reader.ReadBytes(1); clip.Unknown6 = reader.ReadBytes(4); clip.Unknown7 = reader.ReadBytes(16); } int numTracks = reader.ReadInt32(); section.TrackList = new List <xaAnimationTrack>(numTracks); for (int i = 0; i < numTracks; i++) { xaAnimationTrack track = new xaAnimationTrack(); section.TrackList.Add(track); track.Name = reader.ReadName(); int numKeyframes = reader.ReadInt32(); track.Unknown1 = reader.ReadBytes(4); track.KeyframeList = new List <xaAnimationKeyframe>(numKeyframes); for (int j = 0; j < numKeyframes; j++) { xaAnimationKeyframe keyframe = new xaAnimationKeyframe(); track.KeyframeList.Add(keyframe); keyframe.Index = reader.ReadInt32(); keyframe.Rotation = reader.ReadQuaternion(); keyframe.Unknown1 = reader.ReadBytes(8); keyframe.Translation = reader.ReadVector3(); keyframe.Scaling = reader.ReadVector3(); } } return(section); }
public void MoveAnimationClip(xaAnimationClip clip, int position) { Parser.AnimationSection.ClipList.Remove(clip); Parser.AnimationSection.ClipList.Insert(position, clip); Changed = true; }