public static void CreateUnknowns(xaMorphKeyframeRef morphRef) { morphRef.Unknown1 = new byte[1]; morphRef.Unknown2 = new byte[1]; }
public void CreateMorphKeyframeRef(string morphClip, int position, string keyframe) { foreach (xaMorphClip clip in Parser.MorphSection.ClipList) { if (clip.Name == morphClip) { xaMorphKeyframeRef morphRef = new xaMorphKeyframeRef(); xa.CreateUnknowns(morphRef); morphRef.Index = -1; morphRef.Name = keyframe; clip.KeyframeRefList.Insert(position, morphRef); Changed = true; return; } } }
protected xaMorphSection ParseMorphSection() { if (reader.ReadByte() == 0) { return null; } xaMorphSection section = new xaMorphSection(); int numIndexSets = reader.ReadInt32(); section.IndexSetList = new List<xaMorphIndexSet>(numIndexSets); for (int i = 0; i < numIndexSets; i++) { xaMorphIndexSet indexSet = new xaMorphIndexSet(); section.IndexSetList.Add(indexSet); indexSet.Unknown1 = reader.ReadBytes(1); int numVertices = reader.ReadInt32(); indexSet.MeshIndices = reader.ReadUInt16Array(numVertices); indexSet.MorphIndices = reader.ReadUInt16Array(numVertices); indexSet.Name = reader.ReadName(); } int numKeyframes = reader.ReadInt32(); section.KeyframeList = new List<xaMorphKeyframe>(numKeyframes); for (int i = 0; i < numKeyframes; i++) { xaMorphKeyframe keyframe = new xaMorphKeyframe(); section.KeyframeList.Add(keyframe); int numVertices = reader.ReadInt32(); keyframe.PositionList = new List<Vector3>(numVertices); keyframe.NormalList = new List<Vector3>(numVertices); for (int j = 0; j < numVertices; j++) { keyframe.PositionList.Add(reader.ReadVector3()); } for (int j = 0; j < numVertices; j++) { keyframe.NormalList.Add(reader.ReadVector3()); } keyframe.Name = reader.ReadName(); } int numClips = reader.ReadInt32(); section.ClipList = new List<xaMorphClip>(numClips); for (int i = 0; i < numClips; i++) { xaMorphClip clip = new xaMorphClip(); section.ClipList.Add(clip); clip.MeshName = reader.ReadName(); clip.Name = reader.ReadName(); int numKeyframeRefs = reader.ReadInt32(); clip.KeyframeRefList = new List<xaMorphKeyframeRef>(numKeyframeRefs); for (int j = 0; j < numKeyframeRefs; j++) { xaMorphKeyframeRef keyframeRef = new xaMorphKeyframeRef(); clip.KeyframeRefList.Add(keyframeRef); keyframeRef.Unknown1 = reader.ReadBytes(1); keyframeRef.Index = reader.ReadInt32(); keyframeRef.Unknown2 = reader.ReadBytes(1); keyframeRef.Name = reader.ReadName(); } clip.Unknown1 = reader.ReadBytes(4); } return section; }