public static SoulsFormats.FLVER2.BufferLayout getLayout(string MTDName, bool isStatic)
        {
            if (MTD_INFO_LIST == null)
            {
                loadMTDInfoList();
            }

            JObject MTD_INFO           = getMTDInfo(MTDName);
            JArray  MTD_LAYOUT_MEMBERS = (JArray)MTD_INFO["LayoutMembers"];

            SoulsFormats.FLVER2.BufferLayout BL = new SoulsFormats.FLVER2.BufferLayout();
            for (int i = 0; i < MTD_LAYOUT_MEMBERS.Count; i++)
            {
                MBT mbt = (MBT)uint.Parse(MTD_LAYOUT_MEMBERS[i]["Type"].ToString());
                MBS mbs = (MBS)uint.Parse(MTD_LAYOUT_MEMBERS[i]["Semantic"].ToString());
                if (isStatic && mbs == MBS.BoneWeights)
                {
                    continue;
                }
                BL.Add(new SoulsFormats.FLVER.LayoutMember(mbt, mbs));
            }

            return(BL);
        }
        public void ChooseGamePreset(FlverGamePreset preset)
        {
            //Layout
            BufferLayout = new SoulsFormats.FLVER2.BufferLayout();

            void Member(MBT t, MBS s, int i = 0)
            {
                var newMemb = new SoulsFormats.FLVER.LayoutMember(t, s, i);

                BufferLayout.Add(newMemb);
            }

            //Texture Channel Setup

            FBXMaterialChannelMap.Clear();

            void Tex(string fbxChannel, string ingameChannel)
            {
                FBXMaterialChannelMap.Add(fbxChannel, ingameChannel);
            }

            //Hardcoded texture channels

            MTDHardcodedTextureChannels.Clear();

            void HardcodeTex(string ingameChannel, string hardcodedValue)
            {
                MTDHardcodedTextureChannels.Add(ingameChannel, hardcodedValue);
            }

            switch (preset)
            {
            case FlverGamePreset.DS1Static:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Byte4C, MBS.Normal);
                Member(MBT.Byte4C, MBS.Tangent);
                Member(MBT.Byte4C, MBS.VertexColor);
                Member(MBT.UV, MBS.UV);

                Tex("Texture", "g_Diffuse");
                Tex("Specular", "g_Specular");
                Tex("NormalMap", "g_Bumpmap");

                HardcodeTex("g_DetailBumpmap", "");

                FlverVersion = 0x2000C;
                TpfEncoding  = 2;
                TpfFlag2     = 3;

                NormalWValue = 0;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "P_Metal[DSB]";
                UseDirectBoneIndices          = false;
                Unk0x5CValue = 0;
                Unk0x68Value = 0;

                FakeTextureDirectory = "";

                break;

            case FlverGamePreset.DS1Skinned:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Short4toFloat4A, MBS.BoneWeights);
                Member(MBT.Byte4C, MBS.Normal);
                Member(MBT.Byte4C, MBS.Tangent);
                Member(MBT.Byte4C, MBS.VertexColor);
                Member(MBT.UV, MBS.UV);

                Tex("Texture", "g_Diffuse");
                Tex("Specular", "g_Specular");
                Tex("NormalMap", "g_Bumpmap");

                HardcodeTex("g_DetailBumpmap", "");

                FlverVersion = 0x2000C;
                TpfEncoding  = 2;
                TpfFlag2     = 3;

                NormalWValue = 0;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "P_Metal[DSB]";
                UseDirectBoneIndices          = false;
                Unk0x5CValue = 0;
                Unk0x68Value = 0;

                FakeTextureDirectory = "";

                break;

            case FlverGamePreset.DS2Static:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.Normal);
                Member(MBT.Byte4B, MBS.Tangent);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Byte4C, MBS.BoneWeights);
                Member(MBT.Byte4C, MBS.VertexColor, 0);
                Member(MBT.Byte4C, MBS.VertexColor, 1);
                Member(MBT.UV, MBS.UV);

                Tex("Texture", "g_DiffuseTexture");
                Tex("Specular", "g_SpecularTexture");
                Tex("NormalMap", "g_BumpmapTexture");

                HardcodeTex("g_BreakBumpmapTexture", @"N:\FRPG2\data\Model\parts\Common\tex\WP_damage_metal_n.tga");

                FlverVersion = 0x20010;
                TpfEncoding  = 2;
                TpfFlag2     = 3;

                NormalWValue = -1;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "W[Ibl][DSB]";
                UseDirectBoneIndices          = false;
                Unk0x5CValue = 1;
                Unk0x68Value = 1;

                FakeTextureDirectory = @"N:\FBX2FLVER\CustomTextures\";

                break;

            case FlverGamePreset.DS2Skinned:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.Normal);
                Member(MBT.Byte4B, MBS.Tangent);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Byte4C, MBS.BoneWeights);
                Member(MBT.Byte4C, MBS.VertexColor, 0);
                Member(MBT.Byte4C, MBS.VertexColor, 1);
                Member(MBT.Byte4C, MBS.VertexColor, 2);
                Member(MBT.UV, MBS.UV);

                Tex("Texture", "g_DiffuseTexture");
                Tex("Specular", "g_SpecularTexture");
                Tex("NormalMap", "g_BumpmapTexture");

                HardcodeTex("g_BreakBumpmapTexture", @"N:\FRPG2\data\Model\parts\Common\tex\WP_damage_metal_n.tga");

                FlverVersion = 0x20010;
                TpfEncoding  = 2;
                TpfFlag2     = 3;

                NormalWValue = -1;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "W[Ibl][DSB]";
                UseDirectBoneIndices          = false;
                Unk0x5CValue = 1;
                Unk0x68Value = 0;

                FakeTextureDirectory = @"N:\FBX2FLVER\CustomTextures\";

                break;

            case FlverGamePreset.DS3Static:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.Normal);
                Member(MBT.Byte4B, MBS.Tangent);
                Member(MBT.Byte4B, MBS.Tangent, 1);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Byte4C, MBS.BoneWeights);
                Member(MBT.Byte4C, MBS.VertexColor, 1);
                Member(MBT.UVPair, MBS.UV);


                Tex("Texture", "g_DiffuseTexture");
                //Tex("Specular", "g_SpecularTexture");
                //Tex("Reflection", "g_ShininessTexture");
                Tex("Specular", "g_ShininessTexture");
                Tex("NormalMap", "g_BumpmapTexture");

                HardcodeTex("g_DamagedNormalTexture", @"N:\SPRJ\data\Other\SysTex\SYSTEX_DummyDamagedNormal.tif");

                FlverVersion = 0x20014;
                TpfEncoding  = 1;
                TpfFlag2     = 3;

                NormalWValue = -1;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "P_WP[ARSN]";
                UseDirectBoneIndices          = true;
                Unk0x5CValue = 0;
                Unk0x68Value = 4;

                FakeTextureDirectory = "";

                break;

            case FlverGamePreset.DS3Skinned:
                Member(MBT.Float3, MBS.Position);
                Member(MBT.Byte4B, MBS.Normal);
                Member(MBT.Byte4B, MBS.Tangent);
                Member(MBT.Byte4B, MBS.Tangent, 1);
                Member(MBT.Byte4B, MBS.BoneIndices);
                Member(MBT.Byte4C, MBS.BoneWeights);
                Member(MBT.UVPair, MBS.UV);
                Member(MBT.Byte4C, MBS.UV, 1);

                Tex("Texture", "SAT_Equip_snp_Texture2D_5_AlbedoMap_0");
                //Tex("Specular", "g_SpecularTexture");
                Tex("Specular", "SAT_Equip_snp_Texture2D_3_ReflectanceMap_0");
                Tex("NormalMap", "SAT_Equip_snp_Texture2D_4_NormalMap_0");

                HardcodeTex("SAT_Equip_snp_Texture2D_1_BlendMask", @"N:\FDP\data\Other\SysTex\SYSTEX_DummyBurn_m.tif");
                HardcodeTex("SAT_Equip_snp_Texture2D_0_EmissiveMap_0", @"N:\FDP\data\Other\SysTex\SYSTEX_DummyBurn_em.tif");
                HardcodeTex("SAT_Equip_snp_Texture2D_2_DamageNormal", @"N:\FDP\data\Other\SysTex\SYSTEX_DummyDamagedNormal.tif");

                FlverVersion = 0x20014;
                TpfEncoding  = 1;
                TpfFlag2     = 3;

                NormalWValue = -1;
                UVScaleX     = 1;
                UVScaleY     = 1;
                PlaceholderMaterialShaderName = "P_BD[ARSN]";
                UseDirectBoneIndices          = true;
                Unk0x5CValue = 0;
                Unk0x68Value = 4;

                FakeTextureDirectory = "";

                break;

            default:
                throw new NotImplementedException();
            }
        }