コード例 #1
0
 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");
         }
         pcc.Exports[MyIndex].Data = data;
     }
 }
コード例 #2
0
            public TreeNode ToTree(int MyIndex, ITalkFile talk, PCCObject pcc)
            {
                string s = "";

                if (Text.Length != 0)
                {
                    s = Text.Substring(0, Text.Length - 1);
                }
                TreeNode res = new TreeNode(MyIndex + " : " + s + "  " + talk.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("ReplyType : " + pcc.getNameEntry(ReplyTypeValue));
                res.Nodes.Add("Text : " + Text);
                res.Nodes.Add("refText : " + refText + " " + talk.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("GUIStyle : " + pcc.getNameEntry(GUIStyleValue));
                return(res);
            }
コード例 #3
0
            public TreeNode ToTree(int MyIndex, PCCObject pcc)
            {
                string s = "";

                if (Text.Length != 0)
                {
                    s = Text.Substring(0, Text.Length - 1);
                }
                TreeNode res = new TreeNode(MyIndex + " : " + s + "  " + TalkFiles.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
                                + " "
                                + TalkFiles.findDataById(e.refParaphrase)
                                + " "
                                + e.Index
                                + " "
                                + pcc.getNameEntry(e.CategoryType)
                                + " "
                                + 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 + " " + TalkFiles.findDataById(refText, true));
                res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue));
                return(res);
            }
コード例 #4
0
        public static CustomProperty PropertyToGrid(Property p, PCCObject pcc)
        {
            string         cat = p.TypeVal.ToString();
            CustomProperty pg;

            switch (p.TypeVal)
            {
            case Type.BoolProperty:
                pg = new CustomProperty(p.Name, cat, (p.Value.IntValue == 1), typeof(bool), false, true);
                break;

            case Type.FloatProperty:
                byte[] buff = BitConverter.GetBytes(p.Value.IntValue);
                float  f    = BitConverter.ToSingle(buff, 0);
                pg = new CustomProperty(p.Name, cat, f, typeof(float), false, true);
                break;

            case Type.ByteProperty:
            case Type.NameProperty:
                NameProp pp = new NameProp();
                pp.name      = pcc.getNameEntry(p.Value.IntValue);
                pp.nameindex = p.Value.IntValue;
                pg           = new CustomProperty(p.Name, cat, pp, typeof(NameProp), false, true);
                break;

            case Type.ObjectProperty:
                ObjectProp ppo = new ObjectProp();
                ppo.name = pcc.getObjectName(p.Value.IntValue);
                //ppo.name = pcc.GetName(pcc.Exports[p.Value.IntValue].name);
                ppo.nameindex = p.Value.IntValue;
                pg            = new CustomProperty(p.Name, cat, ppo, typeof(ObjectProp), false, true);
                break;

            case Type.StructProperty:
                StructProp ppp = new StructProp();
                ppp.name      = pcc.getNameEntry(p.Value.IntValue);
                ppp.nameindex = p.Value.IntValue;
                byte[] buf = new byte[p.Value.Array.Count()];
                for (int i = 0; i < p.Value.Array.Count(); i++)
                {
                    buf[i] = (byte)p.Value.Array[i].IntValue;
                }
                List <int> buf2 = new List <int>();
                for (int i = 0; i < p.Value.Array.Count() / 4; i++)
                {
                    buf2.Add(BitConverter.ToInt32(buf, i * 4));
                }
                ppp.data = buf2.ToArray();
                pg       = new CustomProperty(p.Name, cat, ppp, typeof(StructProp), false, true);
                break;

            default:
                pg = new CustomProperty(p.Name, cat, p.Value.IntValue, typeof(int), false, true);
                break;
            }
            return(pg);
        }
コード例 #5
0
        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)));
            }
        }
コード例 #6
0
        public 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);
        }
コード例 #7
0
ファイル: AnimSet.cs プロジェクト: solarisstar/ME3Explorer
        public TreeNode ToTree()
        {
            TreeNode res = new TreeNode("AnimSet : " + pcc.Exports[MyIndex].ObjectName + "(#" + MyIndex + ")");

            res.Nodes.Add("PreviewSkelMeshName : " + pcc.getNameEntry(PreviewSkelMeshName));
            res.Nodes.Add("m_pBioAnimSetData : " + m_pBioAnimSetData);
            if (SetData != null)
            {
                res.Nodes.Add(SetData.ToTree());
            }
            res.Nodes.Add(SequencesToTree());
            return(res);
        }
コード例 #8
0
 public void ReadProperties()
 {
     props    = PropertyReader.getPropList(pcc, memory);
     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;
         }
     }
 }
コード例 #9
0
ファイル: DecalActor.cs プロジェクト: Dybuk/ME3Explorer
        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);
        }
コード例 #10
0
        public static string PropertyToText(Property p, PCCObject pcc)
        {
            string s = "";

            s  = "Name: " + pcc.Names[p.Name];
            s += " Type: " + TypeToString((int)p.TypeVal);
            s += " Size: " + p.Value.len.ToString();
            switch (p.TypeVal)
            {
            case Type.StructProperty:
                s += " \"" + pcc.getNameEntry(p.Value.IntValue) + "\" with " + p.Value.Array.Count.ToString() + " bytes";
                break;

            case Type.IntProperty:
            case Type.ObjectProperty:
            case Type.BoolProperty:
            case Type.StringRefProperty:
                s += " Value: " + p.Value.IntValue.ToString();
                break;

            case Type.FloatProperty:
                byte[] buff = BitConverter.GetBytes(p.Value.IntValue);
                float  f    = BitConverter.ToSingle(buff, 0);
                s += " Value: " + f.ToString();
                break;

            case Type.NameProperty:
                s += " " + pcc.Names[p.Value.IntValue];
                break;

            case Type.ByteProperty:
                s += " Value: \"" + p.Value.StringValue + "\" with \"" + pcc.getNameEntry(p.Value.IntValue) + "\"";
                break;

            case Type.ArrayProperty:
                s += " bytes";     //Value: " + p.Value.Array.Count.ToString() + " Elements";
                break;

            case Type.StrProperty:
                if (p.Value.StringValue.Length == 0)
                {
                    break;
                }
                s += " Value: " + p.Value.StringValue.Substring(0, p.Value.StringValue.Length - 1);
                break;
            }
            return(s);
        }
コード例 #11
0
        public TreeNode FindSequences(PCCObject pcc, int index, bool wantFullName = false)
        {
            TreeNode ret = new TreeNode("#" + index.ToString() + ": " + (wantFullName ? pcc.Exports[index].GetFullPath : pcc.Exports[index].ObjectName));

            ret.Name = index.ToString();
            Sequence seq = new Sequence(pcc, index);

            if (seq.SequenceObjects != null)
            {
                for (int i = 0; i < seq.SequenceObjects.Count(); i++)
                {
                    if (pcc.Exports[seq.SequenceObjects[i] - 1].ClassName == "Sequence" || pcc.Exports[seq.SequenceObjects[i] - 1].ClassName.StartsWith("PrefabSequence"))
                    {
                        TreeNode t = FindSequences(pcc, seq.SequenceObjects[i] - 1, wantFullName);
                        ret.Nodes.Add(t);
                    }
                    else if (pcc.Exports[seq.SequenceObjects[i] - 1].ClassName == "SequenceReference")
                    {
                        var props = PropertyReader.getPropList(pcc, pcc.Exports[seq.SequenceObjects[i] - 1]);
                        var propSequenceReference = props.FirstOrDefault(p => pcc.getNameEntry(p.Name).Equals("oSequenceReference"));
                        if (propSequenceReference != null)
                        {
                            TreeNode t = FindSequences(pcc, propSequenceReference.Value.IntValue - 1, wantFullName);
                            ret.Nodes.Add(t);
                        }
                    }
                }
            }
            return(ret);
        }
コード例 #12
0
ファイル: AnimSet.cs プロジェクト: solarisstar/ME3Explorer
        public AnimSet(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            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;
                }
            }
        }
コード例 #13
0
        public BioAnimSetData(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            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;
                }
            }
        }
コード例 #14
0
        public StaticMeshCollectionActor(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            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();
        }
コード例 #15
0
        private static Type getType(PCCObject pcc, int type)
        {
            switch (pcc.getNameEntry(type))
            {
            case "None": return(Type.None);

            case "StructProperty": return(Type.StructProperty);

            case "IntProperty": return(Type.IntProperty);

            case "FloatProperty": return(Type.FloatProperty);

            case "ObjectProperty": return(Type.ObjectProperty);

            case "NameProperty": return(Type.NameProperty);

            case "BoolProperty": return(Type.BoolProperty);

            case "ByteProperty": return(Type.ByteProperty);

            case "ArrayProperty": return(Type.ArrayProperty);

            case "DelegateProperty": return(Type.DelegateProperty);

            case "StrProperty": return(Type.StrProperty);

            case "StringRefProperty": return(Type.StringRefProperty);

            default:
                return(Type.Unknown);
            }
        }
コード例 #16
0
        private static PropertyValue ReadValue(PCCObject pcc, byte[] raw, int start, int type)
        {
            PropertyValue v = new PropertyValue();

            switch (pcc.getNameEntry(type))
            {
            case "IntProperty":
            case "FloatProperty":
            case "ObjectProperty":
            case "StringRefProperty":
                v.IntValue = BitConverter.ToInt32(raw, start);
                v.len      = 4;
                break;

            case "NameProperty":
                v.IntValue = BitConverter.ToInt32(raw, start);
                v.len      = 8;
                break;

            case "BoolProperty":
                if (start < raw.Length)
                {
                    v.IntValue = raw[start];
                }
                v.len = 1;
                break;
            }
            return(v);
        }
コード例 #17
0
ファイル: AnimTree.cs プロジェクト: solarisstar/ME3Explorer
        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);
            }
        }
コード例 #18
0
        public LightVolume(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            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);
        }
コード例 #19
0
ファイル: AddReply.cs プロジェクト: Dybuk/ME3Explorer
 private void textBox3_TextChanged(object sender, EventArgs e)
 {
     int i=0;
     if (Int32.TryParse(textBox3.Text, out i))
     {
         label5.Text = "Preview: " + pcc.getNameEntry(i);
     }
     else
     {
         label5.Text = "Preview: fail";
     }
 }
コード例 #20
0
        public void RefreshSummary()
        {
            string res = "";

            if (Index == -1)
            {
                return;
            }
            if (isExport)
            {
                res += "1.Make a clone of export #" + Index + "\n";
            }
            else
            {
                res += "1.Make a clone of import #" + Index + "\n";
            }
            res += "2.Use name : " + pcc.getNameEntry(listBox9.SelectedIndex) + "\n";
            if (isExport)
            {
                res += "3.Use class : ";
                if (listBox3.SelectedIndex != -1)
                {
                    res += pcc.Exports[listBox3.SelectedIndex].ObjectName;
                }
                if (listBox4.SelectedIndex != -1)
                {
                    res += pcc.Imports[listBox4.SelectedIndex].ObjectName;
                }
                if (listBox7.SelectedIndex != -1)
                {
                    res += "Class";
                }
                res += "\n";
            }
            else
            {
                res += "3.Use class : " + pcc.Imports[Index].ClassName + "\n";
            }
            res += "4.Use data len = " + hb1.ByteProvider.Length + " bytes\n5.Use link : ";
            if (listBox5.SelectedIndex != -1)
            {
                res += getExportPath(listBox5.SelectedIndex);
            }
            if (listBox6.SelectedIndex != -1)
            {
                res += getImportPath(listBox6.SelectedIndex);
            }
            if (listBox8.SelectedIndex != -1)
            {
                res += "Root";
            }
            rtb1.Text = res;
        }
コード例 #21
0
ファイル: AnimNodeSlot.cs プロジェクト: Dybuk/ME3Explorer
        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);
            }
        }
コード例 #22
0
ファイル: BrushComponent.cs プロジェクト: Dybuk/ME3Explorer
        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());
                }
            }
        }
コード例 #23
0
ファイル: GUIDCacheEditor.cs プロジェクト: Dybuk/ME3Explorer
        public void ReadGUIDs(byte[] buff)
        {
            props = PropertyReader.getPropList(pcc, buff);
            int pos   = props[props.Count - 1].offend;
            int count = BitConverter.ToInt32(buff, pos);

            pos  += 4;
            GUIDs = new List <GuidEntry>();
            for (int i = 0; i < count; i++)
            {
                GuidEntry g = new GuidEntry();
                g.NameIdx = BitConverter.ToInt32(buff, pos);
                g.Name    = pcc.getNameEntry(g.NameIdx);
                g.GUID    = new byte[16];
                for (int j = 0; j < 16; j++)
                {
                    g.GUID[j] = buff[pos + j + 8];
                }
                GUIDs.Add(g);
                pos += 24;
            }
        }
コード例 #24
0
        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("");
        }
コード例 #25
0
        public static string PropertyToText(Property p, PCCObject pcc)
        {
            string s = "";

            s  = "Name: " + p.Name;
            s += ", Type: " + TypeToString((int)p.TypeVal);
            s += ", Size: " + p.Size + ",";
            switch (p.TypeVal)
            {
            case Type.StructProperty:
                s += " \"" + pcc.getNameEntry(p.Value.IntValue) + "\" with " + p.Size + " bytes";
                break;

            case Type.IntProperty:
            case Type.ObjectProperty:
            case Type.StringRefProperty:
                s += " Value: " + p.Value.IntValue.ToString();
                break;

            case Type.BoolProperty:
                s += " Value: " + (p.raw[24] == 1);
                break;

            case Type.FloatProperty:
                s += " Value: " + p.Value.FloatValue;
                break;

            case Type.NameProperty:
                s += " " + p.Value.StringValue;
                break;

            case Type.ByteProperty:
                s += " Value: \"" + p.Value.StringValue + "\", with int: " + p.Value.IntValue;
                break;

            case Type.ArrayProperty:
                s += " bytes";     //Value: " + p.Value.Array.Count.ToString() + " Elements";
                break;

            case Type.StrProperty:
                if (p.Value.StringValue.Length == 0)
                {
                    break;
                }
                s += " Value: " + p.Value.StringValue;
                break;
            }
            return(s);
        }
コード例 #26
0
        public BioPlaypenVolumeAdditive(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            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);
        }
コード例 #27
0
ファイル: AnimTree.cs プロジェクト: solarisstar/ME3Explorer
        public AnimTree(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]);
            BitConverter.IsLittleEndian = true;
            AnimGroups = new List <AnimGroupEntry>();
            ComposePrePassBoneNames = new List <string>();
            SkelControlLists        = new List <SkelControlListEntry>();
            Children = new List <ChildrenEntry>();
            BitConverter.IsLittleEndian = true;
            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;
                }
            }
        }
コード例 #28
0
        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);
        }
コード例 #29
0
        public WwiseAmbientSound(PCCObject Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc, data);
            BitConverter.IsLittleEndian = true;
            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();
        }
コード例 #30
0
        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);
        }