Beispiel #1
0
        public void Read(string filePath)
        {
            using (FileStream stream = new FileStream(filePath, FileMode.Open))
            {
                try
                {
                    BinaryReader reader = new BinaryReader(stream);

                    signature = reader.ReadUInt64();
                    variableDataSectionOffset   = reader.ReadUInt16();
                    externalFileSectionOffset   = reader.ReadUInt16();
                    variableDataSectionCount    = reader.ReadUInt16();
                    externalFileSectionCount    = reader.ReadUInt16();
                    dataSectionsLength          = reader.ReadUInt32();
                    reader.BaseStream.Position += 4;
                    textureCount = reader.ReadUInt16();
                    reader.BaseStream.Position += 6;
                    hideMeshGroupCount          = reader.ReadByte();
                    showMeshGroupCount          = reader.ReadByte();
                    textureSwapCount            = reader.ReadByte();
                    unknown0 = reader.ReadByte();
                    boneModelAttachmentCount    = reader.ReadByte();
                    cnpModelAttachmentCount     = reader.ReadByte();
                    reader.BaseStream.Position += 2;

                    variableDataEntries    = new VariableDataEntry[variableDataSectionCount];
                    externalFileEntries    = new ulong[externalFileSectionCount];
                    hideMeshGroupEntries   = new uint[hideMeshGroupCount];
                    showMeshGroupEntries   = new uint[showMeshGroupCount];
                    textureSwapEntries     = new TextureSwapEntry[textureSwapCount];
                    boneModelAttachEntries = new BoneModelAttachEntry[boneModelAttachmentCount];
                    cnpModelAttachEntries  = new CnpModelAttachEntry[cnpModelAttachmentCount];

                    for (int i = 0; i < hideMeshGroupCount; i++)
                    {
                        hideMeshGroupEntries[i] = reader.ReadUInt32();
                    }

                    for (int i = 0; i < showMeshGroupCount; i++)
                    {
                        showMeshGroupEntries[i] = reader.ReadUInt32();
                    }

                    for (int i = 0; i < textureSwapCount; i++)
                    {
                        textureSwapEntries[i].materialInstanceStrCode32 = reader.ReadUInt32();
                    }
                    for (int i = 0; i < textureSwapCount; i++)
                    {
                        textureSwapEntries[i].textureTypeStrCode32 = reader.ReadUInt32();
                    }
                    for (int i = 0; i < textureSwapCount; i++)
                    {
                        textureSwapEntries[i].textureIndex = reader.ReadInt16();
                    }
                    for (int i = 0; i < textureSwapCount; i++)
                    {
                        textureSwapEntries[i].unknown0 = reader.ReadInt16();
                    }

                    for (int i = 0; i < boneModelAttachmentCount; i++)
                    {
                        boneModelAttachEntries[i].fmdlIndex     = reader.ReadInt16();
                        boneModelAttachEntries[i].frdvIndex     = reader.ReadInt16();
                        boneModelAttachEntries[i].unknownIndex0 = reader.ReadInt16();
                        boneModelAttachEntries[i].unknownIndex1 = reader.ReadInt16();
                        boneModelAttachEntries[i].simIndex      = reader.ReadInt16();
                        boneModelAttachEntries[i].unknownIndex2 = reader.ReadInt16();
                    } //for

                    for (int i = 0; i < cnpModelAttachmentCount; i++)
                    {
                        cnpModelAttachEntries[i].cnpStrCode32   = reader.ReadUInt32();
                        cnpModelAttachEntries[i].emptyStrCode32 = reader.ReadUInt32();
                        cnpModelAttachEntries[i].fmdlIndex      = reader.ReadInt16();
                        cnpModelAttachEntries[i].frdvIndex      = reader.ReadInt16();
                        cnpModelAttachEntries[i].unknownIndex0  = reader.ReadInt16();
                        cnpModelAttachEntries[i].unknownIndex1  = reader.ReadInt16();
                        cnpModelAttachEntries[i].simIndex       = reader.ReadInt16();
                        cnpModelAttachEntries[i].unknownIndex2  = reader.ReadInt16();
                    } //for

                    for (int i = 0; i < variableDataSectionCount; i++)
                    {
                        reader.BaseStream.Position = variableDataSectionOffset + 0x10 * i;

                        variableDataEntries[i].typeEnum                 = reader.ReadByte();
                        variableDataEntries[i].unknown0                 = reader.ReadByte();
                        variableDataEntries[i].subEntryCount            = reader.ReadByte();
                        variableDataEntries[i].meshGroupCount           = reader.ReadByte();
                        variableDataEntries[i].textureSwapCount         = reader.ReadByte();
                        variableDataEntries[i].unknown1                 = reader.ReadByte();
                        variableDataEntries[i].boneModelAttachmentCount = reader.ReadByte();
                        variableDataEntries[i].cnpModelAttachmentCount  = reader.ReadByte();
                        reader.BaseStream.Position   += 4;
                        variableDataEntries[i].offset = reader.ReadUInt32();

                        variableDataEntries[i].variableDataSubEntries = new VariableDataSubEntry[variableDataEntries[i].subEntryCount];
                        reader.BaseStream.Position = variableDataEntries[i].offset;

                        for (int j = 0; j < variableDataEntries[i].subEntryCount; j++)
                        {
                            variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries       = new uint[variableDataEntries[i].meshGroupCount];
                            variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries     = new TextureSwapEntry[variableDataEntries[i].textureSwapCount];
                            variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries = new BoneModelAttachEntry[variableDataEntries[i].boneModelAttachmentCount];
                            variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries  = new CnpModelAttachEntry[variableDataEntries[i].cnpModelAttachmentCount];

                            for (int k = 0; k < variableDataEntries[i].meshGroupCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k] = reader.ReadUInt32();
                            }

                            for (int k = 0; k < variableDataEntries[i].textureSwapCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceStrCode32 = reader.ReadUInt32();
                            }
                            for (int k = 0; k < variableDataEntries[i].textureSwapCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeStrCode32 = reader.ReadUInt32();
                            }
                            for (int k = 0; k < variableDataEntries[i].textureSwapCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureIndex = reader.ReadInt16();
                            }
                            for (int k = 0; k < variableDataEntries[i].textureSwapCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].unknown0 = reader.ReadInt16();
                            }

                            for (int k = 0; k < variableDataEntries[i].boneModelAttachmentCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].fmdlIndex     = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].frdvIndex     = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex0 = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex1 = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].simIndex      = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex2 = reader.ReadInt16();
                            } //for

                            for (int k = 0; k < variableDataEntries[i].cnpModelAttachmentCount; k++)
                            {
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32   = reader.ReadUInt32();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].emptyStrCode32 = reader.ReadUInt32();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].fmdlIndex      = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].frdvIndex      = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex0  = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex1  = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].simIndex       = reader.ReadInt16();
                                variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex2  = reader.ReadInt16();
                            } //for
                        }     //for
                    }         //for

                    reader.BaseStream.Position = externalFileSectionOffset;

                    for (int i = 0; i < externalFileSectionCount; i++)
                    {
                        externalFileEntries[i] = reader.ReadUInt64();
                    }
                } //try
                catch
                {
                    stream.Close();
                } //catch
            }     //using
        }         //Read
Beispiel #2
0
        }         //Write

        public void GetDataFromFv2String(Fv2String fv2String)
        {
            hideMeshGroupEntries   = new uint[fv2String.hideMeshGroupEntries.Length];
            showMeshGroupEntries   = new uint[fv2String.showMeshGroupEntries.Length];
            textureSwapEntries     = new TextureSwapEntry[fv2String.textureSwapEntries.Length];
            boneModelAttachEntries = new BoneModelAttachEntry[fv2String.boneModelAttachEntries.Length];
            cnpModelAttachEntries  = new CnpModelAttachEntry[fv2String.cnpModelAttachEntries.Length];
            variableDataEntries    = new VariableDataEntry[fv2String.variableDataEntries.Length];
            externalFileEntries    = new ulong[fv2String.externalFiles.Length];
            textureCount           = 0;

            for (int i = 0; i < hideMeshGroupEntries.Length; i++)
            {
                try
                {
                    hideMeshGroupEntries[i] = (uint)UInt64.Parse(fv2String.hideMeshGroupEntries[i], System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    hideMeshGroupEntries[i] = (uint)Hashing.HashFileNameLegacy(fv2String.hideMeshGroupEntries[i]);
                } //catch
            }
            for (int i = 0; i < showMeshGroupEntries.Length; i++)
            {
                try
                {
                    showMeshGroupEntries[i] = (uint)UInt64.Parse(fv2String.showMeshGroupEntries[i], System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    showMeshGroupEntries[i] = (uint)Hashing.HashFileNameLegacy(fv2String.showMeshGroupEntries[i]);
                } //catch
            }
            for (int i = 0; i < textureSwapEntries.Length; i++)
            {
                try
                {
                    textureSwapEntries[i].materialInstanceStrCode32 = (uint)UInt64.Parse(fv2String.textureSwapEntries[i].materialInstanceName, System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    textureSwapEntries[i].materialInstanceStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.textureSwapEntries[i].materialInstanceName);
                } //catch

                try
                {
                    textureSwapEntries[i].textureTypeStrCode32 = (uint)UInt64.Parse(fv2String.textureSwapEntries[i].textureTypeName, System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    textureSwapEntries[i].textureTypeStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.textureSwapEntries[i].textureTypeName);
                } //catch

                textureSwapEntries[i].textureIndex = (short)fv2String.textureSwapEntries[i].textureIndex;
                textureSwapEntries[i].unknown0     = -1;
            } //for

            for (int i = 0; i < boneModelAttachEntries.Length; i++)
            {
                boneModelAttachEntries[i].fmdlIndex     = (short)fv2String.boneModelAttachEntries[i].fmdlIndex;
                boneModelAttachEntries[i].frdvIndex     = (short)fv2String.boneModelAttachEntries[i].frdvIndex;
                boneModelAttachEntries[i].unknownIndex0 = -1;
                boneModelAttachEntries[i].unknownIndex1 = -1;
                boneModelAttachEntries[i].simIndex      = (short)fv2String.boneModelAttachEntries[i].simIndex;
                boneModelAttachEntries[i].unknownIndex2 = -1;
            } //for

            for (int i = 0; i < cnpModelAttachEntries.Length; i++)
            {
                try
                {
                    cnpModelAttachEntries[i].cnpStrCode32 = (uint)UInt64.Parse(fv2String.cnpModelAttachEntries[i].cnpStrCode32, System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    cnpModelAttachEntries[i].cnpStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.cnpModelAttachEntries[i].cnpStrCode32);
                } //catch

                cnpModelAttachEntries[i].emptyStrCode32 = 0xBF169F98;
                cnpModelAttachEntries[i].fmdlIndex      = (short)fv2String.cnpModelAttachEntries[i].fmdlIndex;
                cnpModelAttachEntries[i].frdvIndex      = (short)fv2String.cnpModelAttachEntries[i].frdvIndex;
                cnpModelAttachEntries[i].unknownIndex0  = -1;
                cnpModelAttachEntries[i].unknownIndex1  = -1;
                cnpModelAttachEntries[i].simIndex       = (short)fv2String.cnpModelAttachEntries[i].simIndex;
                cnpModelAttachEntries[i].unknownIndex2  = -1;
            } //for

            for (int i = 0; i < variableDataEntries.Length; i++)
            {
                variableDataEntries[i].typeEnum                 = (byte)fv2String.variableDataEntries[i].type;
                variableDataEntries[i].unknown0                 = 0x2;
                variableDataEntries[i].subEntryCount            = (byte)fv2String.variableDataEntries[i].variableDataSubEntries.Length;
                variableDataEntries[i].meshGroupCount           = (byte)fv2String.variableDataEntries[i].meshGroupEntryCount;
                variableDataEntries[i].textureSwapCount         = (byte)fv2String.variableDataEntries[i].textureSwapEntryCount;
                variableDataEntries[i].unknown1                 = 0x0;
                variableDataEntries[i].boneModelAttachmentCount = (byte)fv2String.variableDataEntries[i].boneModelAttachEntryCount;
                variableDataEntries[i].cnpModelAttachmentCount  = (byte)fv2String.variableDataEntries[i].cnpModelAttachEntryCount;

                variableDataEntries[i].variableDataSubEntries = new VariableDataSubEntry[fv2String.variableDataEntries[i].variableDataSubEntries.Length];

                for (int j = 0; j < variableDataEntries[i].subEntryCount; j++)
                {
                    variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries       = new uint[variableDataEntries[i].meshGroupCount];
                    variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries     = new TextureSwapEntry[variableDataEntries[i].textureSwapCount];
                    variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries = new BoneModelAttachEntry[variableDataEntries[i].boneModelAttachmentCount];
                    variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries  = new CnpModelAttachEntry[variableDataEntries[i].cnpModelAttachmentCount];

                    for (int k = 0; k < variableDataEntries[i].meshGroupCount; k++)
                    {
                        try
                        {
                            variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k] = (uint)UInt64.Parse(fv2String.variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k], System.Globalization.NumberStyles.HexNumber);
                        } //try
                        catch
                        {
                            variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k] = (uint)Hashing.HashFileNameLegacy(fv2String.variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k]);
                        } //catch
                    }
                    for (int k = 0; k < variableDataEntries[i].textureSwapCount; k++)
                    {
                        try
                        {
                            variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceStrCode32 = (uint)UInt64.Parse(fv2String.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceName, System.Globalization.NumberStyles.HexNumber);
                        } //try
                        catch
                        {
                            variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceName);
                        } //catch

                        try
                        {
                            variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeStrCode32 = (uint)UInt64.Parse(fv2String.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeName, System.Globalization.NumberStyles.HexNumber);
                        } //try
                        catch
                        {
                            variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeName);
                        } //catch

                        variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureIndex = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureIndex;
                        variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].unknown0     = -1;
                    } //for

                    for (int k = 0; k < variableDataEntries[i].boneModelAttachmentCount; k++)
                    {
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].fmdlIndex     = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].fmdlIndex;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].frdvIndex     = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].frdvIndex;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex0 = -1;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex1 = -1;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].simIndex      = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].simIndex;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].unknownIndex2 = -1;
                    } //for

                    for (int k = 0; k < variableDataEntries[i].cnpModelAttachmentCount; k++)
                    {
                        try
                        {
                            variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32 = (uint)UInt64.Parse(fv2String.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32, System.Globalization.NumberStyles.HexNumber);
                        } //try
                        catch
                        {
                            variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32 = (uint)Hashing.HashFileNameLegacy(fv2String.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32);
                        } //catch

                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].emptyStrCode32 = 0xBF169F98;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].fmdlIndex      = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].fmdlIndex;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].frdvIndex      = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].frdvIndex;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex0  = -1;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex1  = -1;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].simIndex       = (short)fv2String.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].simIndex;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].unknownIndex2  = -1;
                    } //for
                }     //for
            }         //for

            for (int i = 0; i < externalFileEntries.Length; i++)
            {
                try
                {
                    externalFileEntries[i] = UInt64.Parse(fv2String.externalFiles[i], System.Globalization.NumberStyles.HexNumber);
                } //try
                catch
                {
                    externalFileEntries[i] = Hashing.HashFileNameWithExtension(fv2String.externalFiles[i]);
                } //catch

                if (fv2String.externalFiles[i].Contains(".ftex"))
                {
                    textureCount++;
                }
            } //for
        }     //GetDataFromFv2String
Beispiel #3
0
        public void GetDataFromFv2(Fv2 fv2)
        {
            hideMeshGroupEntries   = new string[fv2.hideMeshGroupCount];
            showMeshGroupEntries   = new string[fv2.showMeshGroupCount];
            textureSwapEntries     = new TextureSwapEntry[fv2.textureSwapCount];
            boneModelAttachEntries = new BoneModelAttachEntry[fv2.boneModelAttachmentCount];
            cnpModelAttachEntries  = new CnpModelAttachEntry[fv2.cnpModelAttachmentCount];
            variableDataEntries    = new VariableDataEntry[fv2.variableDataSectionCount];
            externalFiles          = new string[fv2.externalFileSectionCount];

            for (int i = 0; i < fv2.hideMeshGroupCount; i++)
            {
                hideMeshGroupEntries[i] = Hashing.TryGetFmdlName(fv2.hideMeshGroupEntries[i]);
            }

            for (int i = 0; i < fv2.showMeshGroupCount; i++)
            {
                showMeshGroupEntries[i] = Hashing.TryGetFmdlName(fv2.showMeshGroupEntries[i]);
            }

            for (int i = 0; i < fv2.textureSwapCount; i++)
            {
                textureSwapEntries[i].materialInstanceName = Hashing.TryGetFmdlName(fv2.textureSwapEntries[i].materialInstanceStrCode32);
                textureSwapEntries[i].textureTypeName      = Hashing.TryGetFmdlName(fv2.textureSwapEntries[i].textureTypeStrCode32);
                textureSwapEntries[i].textureIndex         = fv2.textureSwapEntries[i].textureIndex;
            } //for

            for (int i = 0; i < fv2.boneModelAttachmentCount; i++)
            {
                boneModelAttachEntries[i].fmdlIndex = fv2.boneModelAttachEntries[i].fmdlIndex;
                boneModelAttachEntries[i].frdvIndex = fv2.boneModelAttachEntries[i].frdvIndex;
                boneModelAttachEntries[i].simIndex  = fv2.boneModelAttachEntries[i].simIndex;
            } //for

            for (int i = 0; i < fv2.cnpModelAttachmentCount; i++)
            {
                cnpModelAttachEntries[i].cnpStrCode32 = Hashing.TryGetFmdlName(fv2.cnpModelAttachEntries[i].cnpStrCode32);
                cnpModelAttachEntries[i].fmdlIndex    = fv2.cnpModelAttachEntries[i].fmdlIndex;
                cnpModelAttachEntries[i].frdvIndex    = fv2.cnpModelAttachEntries[i].frdvIndex;
                cnpModelAttachEntries[i].simIndex     = fv2.cnpModelAttachEntries[i].simIndex;
            } //for

            for (int i = 0; i < fv2.variableDataSectionCount; i++)
            {
                variableDataEntries[i]      = new VariableDataEntry();
                variableDataEntries[i].type = fv2.variableDataEntries[i].typeEnum;
                variableDataEntries[i].meshGroupEntryCount       = fv2.variableDataEntries[i].meshGroupCount;
                variableDataEntries[i].textureSwapEntryCount     = fv2.variableDataEntries[i].textureSwapCount;
                variableDataEntries[i].boneModelAttachEntryCount = fv2.variableDataEntries[i].boneModelAttachmentCount;
                variableDataEntries[i].cnpModelAttachEntryCount  = fv2.variableDataEntries[i].cnpModelAttachmentCount;

                variableDataEntries[i].variableDataSubEntries = new VariableDataSubEntry[fv2.variableDataEntries[i].subEntryCount];

                for (int j = 0; j < fv2.variableDataEntries[i].subEntryCount; j++)
                {
                    variableDataEntries[i].variableDataSubEntries[j] = new VariableDataSubEntry();

                    variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries       = new string[fv2.variableDataEntries[i].meshGroupCount];
                    variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries     = new TextureSwapEntry[fv2.variableDataEntries[i].textureSwapCount];
                    variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries = new BoneModelAttachEntry[fv2.variableDataEntries[i].boneModelAttachmentCount];
                    variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries  = new CnpModelAttachEntry[fv2.variableDataEntries[i].cnpModelAttachmentCount];

                    for (int k = 0; k < fv2.variableDataEntries[i].meshGroupCount; k++)
                    {
                        variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k] = Hashing.TryGetFmdlName(fv2.variableDataEntries[i].variableDataSubEntries[j].meshGroupEntries[k]);
                    }

                    for (int k = 0; k < fv2.variableDataEntries[i].textureSwapCount; k++)
                    {
                        variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceName = Hashing.TryGetFmdlName(fv2.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].materialInstanceStrCode32);
                        variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeName      = Hashing.TryGetFmdlName(fv2.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureTypeStrCode32);
                        variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureIndex         = fv2.variableDataEntries[i].variableDataSubEntries[j].textureSwapEntries[k].textureIndex;
                    } //for

                    for (int k = 0; k < fv2.variableDataEntries[i].boneModelAttachmentCount; k++)
                    {
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].fmdlIndex = fv2.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].fmdlIndex;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].frdvIndex = fv2.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].frdvIndex;
                        variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].simIndex  = fv2.variableDataEntries[i].variableDataSubEntries[j].boneModelAttachEntries[k].simIndex;
                    } //for

                    for (int k = 0; k < fv2.variableDataEntries[i].cnpModelAttachmentCount; k++)
                    {
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32 = Hashing.TryGetFmdlName(fv2.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].cnpStrCode32);
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].fmdlIndex    = fv2.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].fmdlIndex;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].frdvIndex    = fv2.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].frdvIndex;
                        variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].simIndex     = fv2.variableDataEntries[i].variableDataSubEntries[j].cnpModelAttachEntries[k].simIndex;
                    } //for
                }     //for
            }         //for

            for (int i = 0; i < fv2.externalFileSectionCount; i++)
            {
                externalFiles[i] = Hashing.TryGetQarName(fv2.externalFileEntries[i]);
            } //for
        }     //GetDataFromFv2