public void ReadMesh(byte[] raw) { byte[] t1 = new byte[raw.Length - 32]; for (int i = 0; i < raw.Length - 32; i++) { t1[i] = raw[i + 32]; } int size1 = GetArraySize(t1); byte[] t2 = new byte[size1]; for (int i = 0; i < size1; i++) { t2[i] = t1[i + 28]; } List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, t2, 0); foreach (PropertyReader.Property p in pp) { string name = pcc.getNameEntry(p.Name); switch (name) { case "VertexData": ReadVertices(p.raw); break; case "FaceTriData": ReadFaces(p.raw); break; } } }
public void SaveChanges() { if (isEdited) { byte[] buff = Vector3ToBuff(location); int f = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == "location") { f = i; break; } } ; if (f != -1)//has prop { int off = Props[f].offend - 12; for (int i = 0; i < 12; i++) { data[off + i] = buff[i]; } } else//have to add prop { DebugOutput.PrintLn(MyIndex + " : cant find location property"); } pcc.Exports[MyIndex].Data = data; } }
public string ToString(ME3Package p) { if (val == -1) return enumName + ", " + values[0]; else return p.getNameEntry(type) + ", " + p.getNameEntry(val); }
public TreeNode ToTree(int MyIndex, ME3Package pcc) { string s = ""; if (Text.Length != 0) { s = Text.Substring(0, Text.Length - 1); } TreeNode res = new TreeNode(MyIndex + " : " + s + " " + ME3TalkFiles.findDataById(refText)); TreeNode t = new TreeNode("Reply List"); for (int i = 0; i < ReplyList.Count; i++) { EntryListReplyListStruct e = ReplyList[i]; string par = e.Paraphrase; if (par.Length != 0 && par[par.Length - 1] == '\0') { par = par.Substring(0, par.Length - 1); } t.Nodes.Add(i + " : " + par + " " + e.refParaphrase + " " + ME3TalkFiles.findDataById(e.refParaphrase) + " " + e.Index + " " + pcc.getNameEntry(e.CategoryValue)); } res.Nodes.Add(t); TreeNode t2 = new TreeNode("Speaker List"); for (int i = 0; i < SpeakerList.Count; i++) { t2.Nodes.Add(i + " : " + SpeakerList[i]); } res.Nodes.Add(t2); res.Nodes.Add("SpeakerIndex : " + SpeakerIndex); res.Nodes.Add("ListenerIndex : " + ListenerIndex); res.Nodes.Add("ConditionalFunc : " + ConditionalFunc); res.Nodes.Add("ConditionalParam : " + ConditionalParam); res.Nodes.Add("StateTransition : " + StateTransition); res.Nodes.Add("StateTransitionParam : " + StateTransitionParam); res.Nodes.Add("ExportID : " + ExportID); res.Nodes.Add("ScriptIndex : " + ScriptIndex); res.Nodes.Add("CameraIntimacy : " + CameraIntimacy); res.Nodes.Add("Skippable : " + Skippable); res.Nodes.Add("FireConditional : " + FireConditional); res.Nodes.Add("Ambient : " + Ambient); res.Nodes.Add("NonTextline : " + NonTextline); res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures); res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle); res.Nodes.Add("Text : " + Text); res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true)); res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue)); return(res); }
public void SaveChanges() { if (isEdited) { Matrix m = MyMatrix; Vector3 loc = new Vector3(m.M41, m.M42, m.M43); byte[] buff = Vector3ToBuff(loc); int f = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == "location") { f = i; break; } } ; if (f != -1)//has prop { int off = Props[f].offend - 12; for (int i = 0; i < 12; i++) { data[off + i] = buff[i]; } } else//have to add prop { DebugOutput.PrintLn(MyIndex + " : cant find location property"); } Vector3 rot = new Vector3((float)Math.Atan2(m.M32, m.M33), (float)Math.Asin(-1 * m.M31), (float)Math.Atan2(-1 * m.M21, m.M11)); rot = DxToRotator(rot); buff = RotatorToBuff(rot); f = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == "Rotation") { f = i; break; } } ; if (f != -1)//has prop { int off = Props[f].offend - 12; for (int i = 0; i < 12; i++) { data[off + i] = buff[i]; } } else//have to add prop { DebugOutput.PrintLn(MyIndex + " : cant find rotation property"); } pcc.Exports[MyIndex].Data = data; } }
public void ReadTBN(byte[] raw) { int count = GetArrayCount(raw); byte[] buff = GetArrayContent(raw); for (int i = 0; i < count; i++) { TrackBoneNames.Add(pcc.getNameEntry(BitConverter.ToInt32(buff, i * 8))); } }
int FindPropByName(string name) { int res = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == name) { res = i; } } return(res); }
public TreeNode ToTree() { TreeNode res = new TreeNode(pcc.Exports[MyIndex].ObjectName + "(#" + MyIndex + ")"); res.Nodes.Add("bCanStepUpOn : " + bCanStepUpOn); res.Nodes.Add("Tag : " + pcc.getNameEntry(Tag)); res.Nodes.Add("Group : " + pcc.getNameEntry(Group)); res.Nodes.Add("Decal : " + Decal); res.Nodes.Add("DrawScale : " + DrawScale); if (DC != null) { res.Nodes.Add(DC.ToTree()); } return(res); }
public void ReadProperties() { props = PropertyReader.getPropList(pcc.Exports[index]); Textures = new List <TextureParam>(); for (int i = 0; i < props.Count(); i++) { string name = pcc.getNameEntry(props[i].Name); switch (name) { case "TextureParameterValues": ReadTextureParams(props[i].raw); break; } } }
public BioAnimSetData(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); TrackBoneNames = new List<string>(); UseTranslationBoneNames = new List<string>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bAnimRotationOnly": if (p.raw[p.raw.Length - 1] == 1) bAnimRotationOnly = true; break; case "TrackBoneNames": ReadTBN(p.raw); break; case "UseTranslationBoneNames": ReadUTBN(p.raw); break; } }
public BioAnimSetData(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); TrackBoneNames = new List <string>(); UseTranslationBoneNames = new List <string>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bAnimRotationOnly": if (p.raw[p.raw.Length - 1] == 1) { bAnimRotationOnly = true; } break; case "TrackBoneNames": ReadTBN(p.raw); break; case "UseTranslationBoneNames": ReadUTBN(p.raw); break; } } }
public AnimSet(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Sequences = new List<int>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "PreviewSkelMeshName": PreviewSkelMeshName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; if (pcc.isExport(m_pBioAnimSetData - 1) && pcc.Exports[m_pBioAnimSetData - 1].ClassName == "BioAnimSetData") SetData = new BioAnimSetData(pcc, m_pBioAnimSetData - 1); break; case "Sequences": ReadSequences(p.raw); break; } }
public AnimTree(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); AnimGroups = new List<AnimGroupEntry>(); ComposePrePassBoneNames = new List<string>(); SkelControlLists = new List<SkelControlListEntry>(); Children = new List<ChildrenEntry>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AnimGroups": ReadAnimGroups(p.raw); break; case "ComposePrePassBoneNames": ReadPrePassBoneNames(p.raw); break; case "SkelControlLists": ReadSkelControlLists(p.raw); break; case "Children": ReadChildren(p.raw); break; } }
public AnimNodeSlot(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Children = new List<ChildrenEntry>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bSkipTickWhenZeroWeight": if (p.raw[p.raw.Length - 1] == 1) bSkipTickWhenZeroWeight = true; break; case "NodeName": NodeName = p.Value.IntValue; break; case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Children": ReadChildren(p.raw); break; } }
public StaticMeshCollectionActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "Tag": Tag = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } ReadObjects(); ReadMatrices(); }
public BioPlaypenVolumeAdditive(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } MyMatrix = Matrix.Translation(location); }
public StaticMeshCollectionActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } ReadObjects(); ReadMatrices(); }
public AnimSet(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Sequences = new List <int>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "PreviewSkelMeshName": PreviewSkelMeshName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; if (pcc.isExport(m_pBioAnimSetData - 1) && pcc.Exports[m_pBioAnimSetData - 1].ClassName == "BioAnimSetData") { SetData = new BioAnimSetData(pcc, m_pBioAnimSetData - 1); } break; case "Sequences": ReadSequences(p.raw); break; } } }
public WwiseAmbientSound(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bAutoPlay": if (p.raw[p.raw.Length - 1] == 1) bAutoPlay = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public MantleMarker(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) bHasCrossLevelPaths = true; break; case "Tag": Tag = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Owner": Owner = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public void ReadAnimGroups(byte[] raw) { int count = GetArrayCount(raw); byte[] buff = GetArrayContent(raw); int pos = 0; for (int i = 0; i < count; i++) { List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, buff, pos); pos = pp[pp.Count - 1].offend; AnimGroupEntry e = new AnimGroupEntry(); foreach (PropertyReader.Property p in pp) { switch (pcc.getNameEntry(p.Name)) { case "GroupName": e.GroupName = pcc.getNameEntry(p.Value.IntValue); break; case "RateScale": e.RateScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SynchPctPosition": e.SynchPctPosition = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } AnimGroups.Add(e); } }
public LightVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bColored": if (p.raw[p.raw.Length - 1] == 1) { bColored = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); }
public DecalActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Decal": Decal = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } if (pcc.isExport(Decal - 1) && pcc.Exports[Decal - 1].ClassName == "DecalComponent") DC = new DecalComponent(pcc, Decal - 1); MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public void ReadChildren(byte[] raw) { int count = GetArrayCount(raw); byte[] buff = GetArrayContent(raw); int pos = 0; for (int i = 0; i < count; i++) { List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, buff, pos); pos = pp[pp.Count - 1].offend; ChildrenEntry e = new ChildrenEntry(); foreach (PropertyReader.Property p in pp) { switch (pcc.getNameEntry(p.Name)) { case "Name": e.Name = pcc.getNameEntry(p.Value.IntValue); break; case "Weight": e.Weight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Anim": e.Anim = p.Value.IntValue; break; case "bMirrorSkeleton": e.bMirrorSkeleton = (p.raw[p.raw.Length - 1] == 1); break; case "bIsAdditive": e.bIsAdditive = (p.raw[p.raw.Length - 1] == 1); break; } } Children.Add(e); } }
public void ReadMesh(byte[] raw) { byte[] t1 = new byte[raw.Length - 32]; for (int i = 0; i < raw.Length - 32; i++) { t1[i] = raw[i + 32]; } int size1 = GetArraySize(t1); byte[] t2 = new byte[size1]; for (int i = 0; i < size1; i++) { t2[i] = t1[i + 28]; } List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, t2, 0); foreach (PropertyReader.Property p in pp) { string name = pcc.getNameEntry(p.Name); switch (name) { case "VertexData": ReadVertices(p.raw); break; case "FaceTriData": ReadFaces(p.raw); break; } } if (Vertices != null && Faces != null) { BrushMesh = new CustomVertex.PositionColored[Faces.Length]; for (int i = 0; i < Faces.Length; i++) { BrushMesh[i] = new CustomVertex.PositionColored(Vertices[Faces[i]], Color.Orange.ToArgb()); } } }
public TreeNode ToTree(int MyIndex, ME3Package pcc) { string s = ""; if (Text.Length != 0) { s = Text.Substring(0, Text.Length - 1); } TreeNode res = new TreeNode(MyIndex + " : " + s + " " + ME3TalkFiles.findDataById(refText)); TreeNode t = new TreeNode("Entry List"); for (int i = 0; i < EntryList.Count; i++) { t.Nodes.Add(i + " : " + EntryList[i]); } res.Nodes.Add(t); res.Nodes.Add("Listener Index : " + ListenerIndex); res.Nodes.Add("Unskippable : " + Unskippable); res.Nodes.Add("IsDefaultAction : " + IsDefaultAction); res.Nodes.Add("IsMajorDecision : " + IsMajorDecision); res.Nodes.Add("ReplyType : (" + pcc.getNameEntry(ReplyTypeType) + ") " + pcc.getNameEntry(ReplyTypeValue)); res.Nodes.Add("Text : " + Text); res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true)); res.Nodes.Add("ConditionalFunc : " + ConditionalFunc); res.Nodes.Add("ConditionalParam : " + ConditionalParam); res.Nodes.Add("StateTransition : " + StateTransition); res.Nodes.Add("StateTransitionParam : " + StateTransitionParam); res.Nodes.Add("ExportID : " + ExportID); res.Nodes.Add("ScriptIndex : " + ScriptIndex); res.Nodes.Add("CameraIntimacy : " + CameraIntimacy); res.Nodes.Add("FireConditional : " + FireConditional); res.Nodes.Add("Ambient : " + Ambient); res.Nodes.Add("NonTextline : " + NonTextLine); res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures); res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle); res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue)); return(res); }
public void ReadObjects() { int entry = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == "StaticMeshComponents") { entry = i; } } if (entry == -1) { return; } int count = BitConverter.ToInt32(Props[entry].raw, 24); DebugOutput.PrintLn("#" + MyIndex + " StaticMeshCollectionActor : reading " + count + " objects..."); Entries = new List <int>(); for (int i = 0; i < count; i++) { Entries.Add(BitConverter.ToInt32(Props[entry].raw, i * 4 + 28) - 1); } STMC = new List <StaticMeshComponent>(); foreach (int idx in Entries) { if (pcc.isExport(idx) && pcc.Exports[idx].ClassName == "StaticMeshComponent") { STMC.Add(new StaticMeshComponent(pcc, idx)); } else { STMC.Add(null); } DebugOutput.Print(".", false); } DebugOutput.PrintLn(""); }
public WwiseEnvironmentVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Settings": Settings = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Priority": Priority = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } MyMatrix = Matrix.Translation(location); }
public AnimSequence(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Unknown = BitConverter.ToInt32(data, 0); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "RotationCompressionFormat": RotationCompressionFormat = p.Value.IntValue; break; case "KeyEncodingFormat": KeyEncodingFormat = p.Value.IntValue; break; case "bIsAdditive": if (p.raw[p.raw.Length - 1] == 1) bIsAdditive = true; break; case "bNoLoopingInterpolation": if (p.raw[p.raw.Length - 1] == 1) bNoLoopingInterpolation = true; break; case "SequenceName": SequenceName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; break; case "SequenceLength": SequenceLength = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "RateScale": RateScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NumFrames": NumFrames = p.Value.IntValue; break; case "CompressedTrackOffsets": ReadTrackOffsets(p.raw); break; } ReadCompressedBlob(); }
public SplineActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "Physics": Physics = p.Value.IntValue; break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) bEdShouldSnap = true; break; case "bDisableDestination": if (p.raw[p.raw.Length - 1] == 1) bDisableDestination = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); if(to == new Vector3()) to = location; break; case "Connections" : Connections = p.raw; break; } ProcessConnections(); }
public static Vector3 GetLocation(ME3Package Pcc, int Index) { Vector3 r = new Vector3(); if (!Pcc.isExport(Index)) return new Vector3(); List<PropertyReader.Property> pp = PropertyReader.getPropList(Pcc.Exports[Index]); foreach (PropertyReader.Property p in pp) switch (Pcc.getNameEntry(p.Name)) { case "location": r = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } return r; }
public BioPlaypenVolumeAdditive(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } MyMatrix = Matrix.Translation(location); }
public LightVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bColored": if (p.raw[p.raw.Length - 1] == 1) bColored = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); }
public AnimTree(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); AnimGroups = new List <AnimGroupEntry>(); ComposePrePassBoneNames = new List <string>(); SkelControlLists = new List <SkelControlListEntry>(); Children = new List <ChildrenEntry>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AnimGroups": ReadAnimGroups(p.raw); break; case "ComposePrePassBoneNames": ReadPrePassBoneNames(p.raw); break; case "SkelControlLists": ReadSkelControlLists(p.raw); break; case "Children": ReadChildren(p.raw); break; } } }
public TreeNode ToTree() { TreeNode res = new TreeNode(pcc.Exports[MyIndex].ObjectName + "(#" + MyIndex + ")"); res.Nodes.Add("RotationCompressionFormat : " + pcc.getNameEntry(RotationCompressionFormat)); res.Nodes.Add("KeyEncodingFormat : " + pcc.getNameEntry(KeyEncodingFormat)); res.Nodes.Add("bIsAdditive : " + bIsAdditive); res.Nodes.Add("bNoLoopingInterpolation : " + bNoLoopingInterpolation); res.Nodes.Add("SequenceName : " + pcc.getNameEntry(SequenceName)); res.Nodes.Add("m_pBioAnimSetData : " + m_pBioAnimSetData); res.Nodes.Add("SequenceLength : " + SequenceLength); res.Nodes.Add("RateScale : " + RateScale); res.Nodes.Add("NumFrames : " + NumFrames); res.Nodes.Add(TracksToTree()); return(res); }
public WwiseAmbientSound(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bAutoPlay": if (p.raw[p.raw.Length - 1] == 1) { bAutoPlay = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public TreeNode ToTree() { TreeNode res = new TreeNode(pcc.Exports[MyIndex].ObjectName + "(#" + MyIndex + ")"); res.Nodes.Add("FilterMode : " + pcc.getNameEntry(FilterMode)); res.Nodes.Add("bAcceptsDynamicDecals : " + bAcceptsDynamicDecals); res.Nodes.Add("bFlipBackfaceDirection : " + bFlipBackfaceDirection); res.Nodes.Add("bProjectOnBackfaces : " + bProjectOnBackfaces); res.Nodes.Add("bNoClip : " + bNoClip); res.Nodes.Add("bAcceptsLights : " + bAcceptsLights); res.Nodes.Add("bAllowCullDistanceVolume : " + bAllowCullDistanceVolume); res.Nodes.Add("bProjectOnBSP : " + bProjectOnBSP); res.Nodes.Add("bProjectOnSkeletalMeshes : " + bProjectOnSkeletalMeshes); res.Nodes.Add("bProjectOnTerrain : " + bProjectOnTerrain); res.Nodes.Add("DecalMaterial : " + DecalMaterial); res.Nodes.Add("ReplacementPrimitive : " + ReplacementPrimitive); res.Nodes.Add("Width : " + Width); res.Nodes.Add("Height : " + Height); res.Nodes.Add("FarPlane : " + FarPlane); res.Nodes.Add("TileX : " + TileX); res.Nodes.Add("TileY : " + TileY); res.Nodes.Add("NearPlane : " + NearPlane); res.Nodes.Add("DecalRotation : " + DecalRotation); res.Nodes.Add("OffsetX : " + OffsetX); res.Nodes.Add("DepthBias : " + DepthBias); res.Nodes.Add("SlopeScaleDepthBias : " + SlopeScaleDepthBias); res.Nodes.Add("OffsetY : " + OffsetY); res.Nodes.Add("MaxDrawDistance : " + MaxDrawDistance); res.Nodes.Add("CachedMaxDrawDistance : " + CachedMaxDrawDistance); res.Nodes.Add("SortOrder : " + SortOrder); res.Nodes.Add("TranslucencySortPriority : " + TranslucencySortPriority); res.Nodes.Add("LocalTranslucencySortPriority : " + LocalTranslucencySortPriority); return(res); }
public void ProcessConnections() { if (Connections.Length == 0) { return; } byte[] buff = GetArrayContent(Connections); List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, buff, 0); int f = -1; toIdx = -1; foreach (PropertyReader.Property p in pp) { if (pcc.getNameEntry(p.Name) == "ConnectTo") { f = p.Value.IntValue - 1; } } if (pcc.isExport(f) && pcc.Exports[f].ClassName == "SplineActor") { to = SplineActor.GetLocation(pcc, f); toIdx = f; } from = new List <Vector3>(); fromIdx = new List <int>(); buff = new byte[0]; foreach (PropertyReader.Property p in Props) { if (pcc.getNameEntry(p.Name) == "LinksFrom") { buff = GetArrayContent(p.raw); } } for (int i = 0; i < buff.Length / 4; i++) { int Idx = BitConverter.ToInt32(buff, i * 4) - 1; fromIdx.Add(Idx); from.Add(SplineActor.GetLocation(pcc, Idx)); } }
public static Vector3 GetLocation(ME3Package Pcc, int Index) { Vector3 r = new Vector3(); if (!Pcc.isExport(Index)) { return(new Vector3()); } List <PropertyReader.Property> pp = PropertyReader.getPropList(Pcc.Exports[Index]); foreach (PropertyReader.Property p in pp) { switch (Pcc.getNameEntry(p.Name)) { case "location": r = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } return(r); }
public AnimNodeSlot(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Children = new List <ChildrenEntry>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bSkipTickWhenZeroWeight": if (p.raw[p.raw.Length - 1] == 1) { bSkipTickWhenZeroWeight = true; } break; case "NodeName": NodeName = p.Value.IntValue; break; case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Children": ReadChildren(p.raw); break; } } }
public TargetPoint(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) bEdShouldSnap = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public DecalComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) #region { case "FilterMode": FilterMode = p.Value.IntValue; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDecals = true; } break; case "bFlipBackfaceDirection": if (p.raw[p.raw.Length - 1] == 1) { bFlipBackfaceDirection = true; } break; case "bProjectOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnBackfaces = true; } break; case "bNoClip": if (p.raw[p.raw.Length - 1] == 1) { bNoClip = true; } break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsLights = true; } break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) { bAllowCullDistanceVolume = true; } break; case "bProjectOnBSP": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnBSP = true; } break; case "bProjectOnSkeletalMeshes": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnSkeletalMeshes = true; } break; case "bProjectOnTerrain": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnTerrain = true; } break; case "DecalMaterial": DecalMaterial = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "Width": Width = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Height": Height = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "FarPlane": FarPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileX": TileX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileY": TileY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NearPlane": NearPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DecalRotation": DecalRotation = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetX": OffsetX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DepthBias": DepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SlopeScaleDepthBias": SlopeScaleDepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetY": OffsetY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SortOrder": SortOrder = p.Value.IntValue; break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; } } #endregion }
public TreeNode ToTree(int MyIndex, ME3Package pcc) { string s = ""; if (Text.Length != 0) s = Text.Substring(0, Text.Length - 1); TreeNode res = new TreeNode(MyIndex + " : " + s + " " + ME3TalkFiles.findDataById(refText)); TreeNode t = new TreeNode("Entry List"); for (int i = 0; i < EntryList.Count; i++) t.Nodes.Add(i + " : " + EntryList[i]); res.Nodes.Add(t); res.Nodes.Add("Listener Index : " + ListenerIndex); res.Nodes.Add("Unskippable : " + Unskippable); res.Nodes.Add("IsDefaultAction : " + IsDefaultAction); res.Nodes.Add("IsMajorDecision : " + IsMajorDecision); res.Nodes.Add("ReplyType : (" + pcc.getNameEntry(ReplyTypeType) + ") " + pcc.getNameEntry(ReplyTypeValue)); res.Nodes.Add("Text : " + Text); res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true)); res.Nodes.Add("ConditionalFunc : " + ConditionalFunc); res.Nodes.Add("ConditionalParam : " + ConditionalParam); res.Nodes.Add("StateTransition : " + StateTransition); res.Nodes.Add("StateTransitionParam : " + StateTransitionParam); res.Nodes.Add("ExportID : " + ExportID); res.Nodes.Add("ScriptIndex : " + ScriptIndex); res.Nodes.Add("CameraIntimacy : " + CameraIntimacy); res.Nodes.Add("FireConditional : " + FireConditional); res.Nodes.Add("Ambient : " + Ambient); res.Nodes.Add("NonTextline : " + NonTextLine); res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures); res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle); res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue)); return res; }
public BioTriggerVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bProcessAllActors": if (p.raw[p.raw.Length - 1] == 1) { bProcessAllActors = true; } break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) { bBlockActors = true; } break; case "Enabled": if (p.raw[p.raw.Length - 1] == 1) { Enabled = true; } break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "OneShot": if (p.raw[p.raw.Length - 1] == 1) { OneShot = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "LocationPriority": LocationPriority = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion } } MyMatrix = Matrix.Translation(location); }
public TreeNode ToTree(int MyIndex, ME3Package pcc) { string s = ""; if (Text.Length != 0) s = Text.Substring(0, Text.Length - 1); TreeNode res = new TreeNode(MyIndex + " : " + s + " " + ME3TalkFiles.findDataById(refText)); TreeNode t = new TreeNode("Reply List"); for (int i = 0; i < ReplyList.Count; i++) { EntryListReplyListStruct e = ReplyList[i]; string par = e.Paraphrase; if (par.Length != 0 && par[par.Length - 1] == '\0') par = par.Substring(0, par.Length - 1); t.Nodes.Add(i + " : " + par + " " + e.refParaphrase + " " + ME3TalkFiles.findDataById(e.refParaphrase) + " " + e.Index + " " + pcc.getNameEntry(e.CategoryValue)); } res.Nodes.Add(t); TreeNode t2 = new TreeNode("Speaker List"); for (int i = 0; i < SpeakerList.Count; i++) t2.Nodes.Add(i + " : " + SpeakerList[i]); res.Nodes.Add(t2); res.Nodes.Add("SpeakerIndex : " + SpeakerIndex); res.Nodes.Add("ListenerIndex : " + ListenerIndex); res.Nodes.Add("ConditionalFunc : " + ConditionalFunc); res.Nodes.Add("ConditionalParam : " + ConditionalParam); res.Nodes.Add("StateTransition : " + StateTransition); res.Nodes.Add("StateTransitionParam : " + StateTransitionParam); res.Nodes.Add("ExportID : " + ExportID); res.Nodes.Add("ScriptIndex : " + ScriptIndex); res.Nodes.Add("CameraIntimacy : " + CameraIntimacy); res.Nodes.Add("Skippable : " + Skippable); res.Nodes.Add("FireConditional : " + FireConditional); res.Nodes.Add("Ambient : " + Ambient); res.Nodes.Add("NonTextline : " + NonTextline); res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures); res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle); res.Nodes.Add("Text : " + Text); res.Nodes.Add("refText : " + refText + " " + ME3TalkFiles.findDataById(refText, true)); res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue)); return res; }
public BrushComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "RBChannel": RBChannel = p.Value.IntValue; break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) BlockRigidBody = true; break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) CollideActors = true; break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) CanBlockCamera = true; break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockZeroExtent = true; break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockNonZeroExtent = true; break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) BlockActors = true; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) bCastDynamicShadow = true; break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDominantLightShadows = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicLights = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) bAcceptsFoliage = true; break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowAmbientOcclusion = true; break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) bAllowShadowFade = true; break; case "Brush": Brush = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "CachedPhysBrushDataVersion": CachedPhysBrushDataVersion = p.Value.IntValue; break; case "BrushAggGeom": ReadMesh(p.raw); break; } }
public BioTriggerVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bProcessAllActors": if (p.raw[p.raw.Length - 1] == 1) bProcessAllActors = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "Enabled": if (p.raw[p.raw.Length - 1] == 1) Enabled = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "OneShot": if (p.raw[p.raw.Length - 1] == 1) OneShot = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "LocationPriority": LocationPriority = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion } MyMatrix = Matrix.Translation(location); }
public DecalComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) #region { case "FilterMode": FilterMode = p.Value.IntValue; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bFlipBackfaceDirection": if (p.raw[p.raw.Length - 1] == 1) bFlipBackfaceDirection = true; break; case "bProjectOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) bProjectOnBackfaces = true; break; case "bNoClip": if (p.raw[p.raw.Length - 1] == 1) bNoClip = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bProjectOnBSP": if (p.raw[p.raw.Length - 1] == 1) bProjectOnBSP = true; break; case "bProjectOnSkeletalMeshes": if (p.raw[p.raw.Length - 1] == 1) bProjectOnSkeletalMeshes = true; break; case "bProjectOnTerrain": if (p.raw[p.raw.Length - 1] == 1) bProjectOnTerrain = true; break; case "DecalMaterial": DecalMaterial = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "Width": Width = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Height": Height = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "FarPlane": FarPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileX": TileX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileY": TileY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NearPlane": NearPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DecalRotation": DecalRotation = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetX": OffsetX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DepthBias": DepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SlopeScaleDepthBias": SlopeScaleDepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetY": OffsetY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SortOrder": SortOrder = p.Value.IntValue; break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; } #endregion }
public static void ImportImmutableProperty(ME3Package pcc, ME3Package importpcc, Property p, string className, MemoryStream m, bool inStruct = false) { string name = importpcc.getNameEntry(p.Name); int idxname = pcc.FindNameOrAdd(name); if (name == "None") return; string type = importpcc.getNameEntry(BitConverter.ToInt32(p.raw, 8)); int idxtype = pcc.FindNameOrAdd(type); string name2; int idxname2; int size, count, pos; List<Property> Props; switch (type) { case "IntProperty": case "FloatProperty": case "ObjectProperty": case "StringRefProperty": m.Write(BitConverter.GetBytes(p.Value.IntValue), 0, 4); break; case "NameProperty": m.Write(BitConverter.GetBytes(pcc.FindNameOrAdd(importpcc.getNameEntry(p.Value.IntValue))), 0, 4); //preserve index or whatever the second part of a namereference is m.Write(p.raw, 28, 4); break; case "BoolProperty": m.WriteByte((byte)p.Value.IntValue); break; case "BioMask4Property": m.WriteByte((byte)p.Value.IntValue); break; case "ByteProperty": name2 = importpcc.getNameEntry(BitConverter.ToInt32(p.raw, 24)); idxname2 = pcc.FindNameOrAdd(name2); if (p.Size == 8) { m.Write(BitConverter.GetBytes(pcc.FindNameOrAdd(importpcc.getNameEntry(p.Value.IntValue))), 0, 4); m.Write(new byte[4], 0, 4); } else { m.WriteByte(p.raw[32]); } break; case "StrProperty": name2 = p.Value.StringValue + '\0'; m.Write(BitConverter.GetBytes(-name2.Length), 0, 4); foreach (char c in name2) { m.WriteByte((byte)c); m.WriteByte(0); } break; case "StructProperty": size = BitConverter.ToInt32(p.raw, 16); name2 = importpcc.getNameEntry(BitConverter.ToInt32(p.raw, 24)); idxname2 = pcc.FindNameOrAdd(name2); pos = 32; Props = new List<Property>(); try { Props = ReadProp(importpcc, p.raw, pos); } catch (Exception) { } if (Props.Count == 0 || Props[0].TypeVal == PropertyType.Unknown) { for (int i = 0; i < size; i++) m.WriteByte(p.raw[32 + i]); } else { foreach (Property pp in Props) ImportImmutableProperty(pcc, importpcc, pp, className, m, inStruct); } break; case "ArrayProperty": size = BitConverter.ToInt32(p.raw, 16); count = BitConverter.ToInt32(p.raw, 24); ArrayType arrayType = ME3UnrealObjectInfo.getArrayType(className, importpcc.getNameEntry(p.Name), inStruct); pos = 28; List<Property> AllProps = new List<Property>(); if (arrayType == ArrayType.Struct) { for (int i = 0; i < count; i++) { Props = new List<Property>(); try { Props = ReadProp(importpcc, p.raw, pos); } catch (Exception) { } AllProps.AddRange(Props); if (Props.Count != 0) { pos = Props[Props.Count - 1].offend; } } } m.Write(BitConverter.GetBytes(count), 0, 4); if (AllProps.Count != 0) { foreach (Property pp in AllProps) ImportImmutableProperty(pcc, importpcc, pp, className, m, inStruct); } else if (arrayType == ArrayType.Name) { for (int i = 0; i < count; i++) { string s = importpcc.getNameEntry(BitConverter.ToInt32(p.raw, 28 + i * 8)); m.Write(BitConverter.GetBytes(pcc.FindNameOrAdd(s)), 0, 4); //preserve index or whatever the second part of a namereference is m.Write(p.raw, 32 + i * 8, 4); } } else { m.Write(p.raw, 28, size - 4); } break; default: case "DelegateProperty": throw new NotImplementedException(type); } }
public InterpActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "RemoteRole": RemoteRole = p.Value.IntValue; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bStopOnEncroach": if (p.raw[p.raw.Length - 1] == 1) bStopOnEncroach = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "bNoEncroachCheck": if (p.raw[p.raw.Length - 1] == 1) bNoEncroachCheck = true; break; case "bPawnCanBaseOn": if (p.raw[p.raw.Length - 1] == 1) bPawnCanBaseOn = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) bCollideComplex = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) bHiddenEd = true; break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) bBioSnapToBase = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NetUpdateFrequency": NetUpdateFrequency = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public BlockingVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Vector3 v; Tag = -1; Group = -1; foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region Props case "bAllowFluidSurfaceInteraction": if (p.raw[p.raw.Length - 1] == 1) bAllowFluidSurfaceInteraction = true; break; case "bBlockCamera": if (p.raw[p.raw.Length - 1] == 1) bBlockCamera = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "bInclusionaryList": if (p.raw[p.raw.Length - 1] == 1) bInclusionaryList = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bSafeFall": if (p.raw[p.raw.Length - 1] == 1) bSafeFall = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "location": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); location = v; break; case "DrawScale3D": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); DrawScale3D = v; break; #endregion } MyMatrix = Matrix.Scaling(DrawScale3D) * Matrix.Translation(location); }
public StaticMeshActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { string s =pcc.getNameEntry(p.Name); switch (s) { #region case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) bCollideComplex = true; break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) bHiddenEd = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public MantleMarker(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) { bHasCrossLevelPaths = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Owner": Owner = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public Emitter(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bNoVFXSound": if (p.raw[p.raw.Length - 1] == 1) bNoVFXSound = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) bBioSnapToBase = true; break; case "bCurrentlyActive": if (p.raw[p.raw.Length - 1] == 1) bCurrentlyActive = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bPostUpdateTickGroup": if (p.raw[p.raw.Length - 1] == 1) bPostUpdateTickGroup = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "ParticleSystemComponent": ParticleSystemComponent = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public CoverLink(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "LocationDescription": LocationDescription = p.Value.IntValue; break; case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) bHasCrossLevelPaths = true; break; case "bAutoAdjust": if (p.raw[p.raw.Length - 1] == 1) bAutoAdjust = true; break; case "bDisabled": if (p.raw[p.raw.Length - 1] == 1) bDisabled = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPlayerOnly": if (p.raw[p.raw.Length - 1] == 1) bPlayerOnly = true; break; case "bLooped": if (p.raw[p.raw.Length - 1] == 1) bLooped = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bPathsChanged": if (p.raw[p.raw.Length - 1] == 1) bPathsChanged = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "NextCoverLink": NextCoverLink = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CircularRadius": CircularRadius = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxFireLinkDist": MaxFireLinkDist = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "Cost": Cost = p.Value.IntValue; break; case "ExtraCost": ExtraCost = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public static InterpCurveFloat GetCurveFloat(PropertyReader.Property p, ME3Package pcc) { InterpCurveFloat CurveFloat = new InterpCurveFloat(); CurveFloat.Points = new List<InterpCurvePointFloat>(); int pos = 60; int count = BitConverter.ToInt32(p.raw, 56); for (int j = 0; j < count; j++) { List<PropertyReader.Property> p2 = PropertyReader.ReadProp(pcc, p.raw, pos); InterpCurvePointFloat point = new InterpCurvePointFloat(); for (int i = 0; i < p2.Count(); i++) { if (pcc.getNameEntry(p2[i].Name) == "InVal") point.InVal = BitConverter.ToSingle(p2[i].raw, 24); else if (pcc.getNameEntry(p2[i].Name) == "OutVal") { point.OutVal = BitConverter.ToSingle(p2[i].raw, 24); } else if (pcc.getNameEntry(p2[i].Name) == "ArriveTangent") { point.ArriveTangent = BitConverter.ToSingle(p2[i].raw, 24); } else if (pcc.getNameEntry(p2[i].Name) == "LeaveTangent") { point.LeaveTangent = BitConverter.ToSingle(p2[i].raw, 24); } else if (pcc.getNameEntry(p2[i].Name) == "InterpMode") point.InterpMode = new byteprop(p2[i].raw, "EInterpCurveMode", new string[] { "CIM_Linear", "CIM_CurveAuto", "CIM_Constant", "CIM_CurveUser", "CIM_CurveBreak", "CIM_CurveAutoClamped" }); pos += p2[i].raw.Length; } CurveFloat.Points.Add(point); } return CurveFloat; }
public StaticMeshComponent (ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "LightMapEncoding": LightMapEncoding = p.Value.IntValue; break; case "RBChannel": RBChannel = p.Value.IntValue; break; case "DepthPriorityGroup": DepthPriorityGroup = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bIgnoreInstanceForTextureStreaming": if (p.raw[p.raw.Length - 1] == 1) bIgnoreInstanceForTextureStreaming = true; break; case "CastShadow": if (p.raw[p.raw.Length - 1] == 1) CastShadow = true; break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) CollideActors = true; break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) BlockRigidBody = true; break; case "bForceDirectLightMap": if (p.raw[p.raw.Length - 1] == 1) bForceDirectLightMap = true; break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) bCastDynamicShadow = true; break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDominantLightShadows = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicLights = true; break; case "bCullModulatedShadowOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) bCullModulatedShadowOnBackfaces = true; break; case "bCullModulatedShadowOnEmissive": if (p.raw[p.raw.Length - 1] == 1) bCullModulatedShadowOnEmissive = true; break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowAmbientOcclusion = true; break; case "bUsePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) bUsePrecomputedShadows = true; break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) CanBlockCamera = true; break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) bAllowShadowFade = true; break; case "bBioIsReceivingDecals": if (p.raw[p.raw.Length - 1] == 1) bBioIsReceivingDecals = true; break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockNonZeroExtent = true; break; case "bAcceptsStaticDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsStaticDecals = true; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) bAcceptsFoliage = true; break; case "HiddenGame": if (p.raw[p.raw.Length - 1] == 1) HiddenGame = true; break; case "bBioForcePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) bBioForcePrecomputedShadows = true; break; case "bCastHiddenShadow": if (p.raw[p.raw.Length - 1] == 1) bCastHiddenShadow = true; break; case "bUseAsOccluder": if (p.raw[p.raw.Length - 1] == 1) bUseAsOccluder = true; break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockZeroExtent = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bAllowApproximateOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowApproximateOcclusion = true; break; case "bSelfShadowOnly": if (p.raw[p.raw.Length - 1] == 1) bSelfShadowOnly = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "bUseOnePassLightingOnTranslucency": if (p.raw[p.raw.Length - 1] == 1) bUseOnePassLightingOnTranslucency = true; break; case "bLockLightingCache": if (p.raw[p.raw.Length - 1] == 1) bLockLightingCache = true; break; case "bDisableAllRigidBody": if (p.raw[p.raw.Length - 1] == 1) bDisableAllRigidBody = true; break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) BlockActors = true; break; case "bNotifyRigidBodyCollision": if (p.raw[p.raw.Length - 1] == 1) bNotifyRigidBodyCollision = true; break; case "bIgnoreRadialImpulse": if (p.raw[p.raw.Length - 1] == 1) bIgnoreRadialImpulse = true; break; case "bIgnoreRadialForce": if (p.raw[p.raw.Length - 1] == 1) bIgnoreRadialForce = true; break; case "HiddenEditor": if (p.raw[p.raw.Length - 1] == 1) HiddenEditor = true; break; case "StaticMesh": StaticMesh_ = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "ShadowParent": ShadowParent = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MinDrawDistance": MinDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioObstruction": AudioObstruction = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OverriddenLODMaxRange": OverriddenLODMaxRange = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale": Scale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale3D": Scale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotation = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "Translation": Translation = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "MassiveLODDistance": MassiveLODDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MotionBlurScale": MotionBlurScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; case "ForcedLodModel": ForcedLodModel = p.Value.IntValue; break; #endregion } if (StaticMesh_ - 1 >= 0 && StaticMesh_ - 1 < pcc.Exports.Count) if (pcc.Exports[StaticMesh_ - 1].ClassName == "StaticMesh") { STM = new StaticMesh(pcc, StaticMesh_ - 1); STM.Mesh.Bounds.t = null;//save memory STM.Mesh.Edges.t = null; STM.Mesh.Buffers.t = null; STM.Mesh.IdxBuf.t = null; STM.Mesh.kDOPTree.t = null; STM.Mesh.Mat.t = null; STM.Mesh.RawTris.t = null; STM.Mesh.UnknownPart.t = null; STM.Mesh.Vertices.t = null; } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(Scale3D); MyMatrix *= Matrix.Scaling(Scale, Scale, Scale); Vector3 rot = RotatorToDX(Rotation); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(Translation); }
public void LoadInterpData(int idx, ME3Package pccobject) { TimeScale.RemoveAllChildren(); TimeScale.Width = 3600; TimelineView.RemoveAllChildren(); TimelineView.Width = 3600; scrollbarH.Maximum = 3600; PPath line; SText text; for (int i = 0; i < TimeScale.Width; i += 60) { line = PPath.CreateLine(i, 1, i, Timeline.InfoHeight); line.Pickable = false; line.Pen = new Pen(Color.FromArgb(110, 110, 110)); TimeScale.AddChild(line); text = new SText(i / 60 - 1 + ".00", Color.FromArgb(175, 175, 175), false); text.Pickable = false; text.TranslateBy(i + 2, Timeline.InfoHeight - text.Height); TimeScale.AddChild(text); } pcc = pccobject; index = idx; foreach (InterpGroup g in InterpGroups) RemoveChild(g.listEntry); InterpGroups.Clear(); List<PropertyReader.Property> props = PropertyReader.getPropList(pcc.Exports[index]); List<int> groups = new List<int>(); foreach (PropertyReader.Property p in props) { if (pcc.getNameEntry(p.Name) == "InterpLength") InterpLength = BitConverter.ToSingle(p.raw, 24); if (pcc.getNameEntry(p.Name) == "EdSectionStart") EdSectionStart = BitConverter.ToSingle(p.raw, 24); if (pcc.getNameEntry(p.Name) == "EdSectionEnd") EdSectionEnd = BitConverter.ToSingle(p.raw, 24); if (pcc.getNameEntry(p.Name) == "m_nBioCutSceneVersion") m_nBioCutSceneVersion = p.Value.IntValue; if (pcc.getNameEntry(p.Name) == "m_pSFXSceneData") m_pSFXSceneData = p.Value.IntValue; if (pcc.getNameEntry(p.Name) == "ObjInstanceVersion") ObjInstanceVersion = p.Value.IntValue; if (pcc.getNameEntry(p.Name) == "ParentSequence") ParentSequence = p.Value.IntValue; if (pcc.getNameEntry(p.Name) == "InterpGroups") { for (int i = 0; i < p.Value.Array.Count; i += 4) groups.Add(BitConverter.ToInt32(new byte[] { (byte)p.Value.Array[i].IntValue, (byte)p.Value.Array[i + 1].IntValue, (byte)p.Value.Array[i + 2].IntValue, (byte)p.Value.Array[i + 3].IntValue }, 0) - 1); } } foreach(int i in groups) { if (pcc.Exports[i].ClassName.StartsWith("InterpGroup")) addGroup(new InterpGroup(i, pcc)); else addGroup(new SFXSceneGroup(i, pcc)); } TimeScale.MoveToFront(); PPath startmark = PPath.CreatePolygon(53,1, 61,1, 61,9); startmark.Pen = null; startmark.Brush = new SolidBrush(Color.FromArgb(255,80,80)); startmark.Pickable = false; TimeScale.AddChild(startmark); endmark = PPath.CreatePolygon(InterpLength * 60 + 61, 1, InterpLength * 60 + 69, 1, InterpLength * 60 + 61, 9); endmark.Pen = null; endmark.Brush = startmark.Brush; TimeScale.AddChild(endmark); foreach (InterpGroup g in InterpGroups) { foreach (InterpTrack t in g.InterpTracks) { t.GetKeyFrames(); t.DrawKeyFrames(); TimelineView.AddChild(t.timelineEntry); } } }