using System.Collections.Generic;
using System.Linq;
using Flagrum.Core.Gfxbin.Gmdl.Components;

namespace Flagrum.Core.Gfxbin.Gmdl.Constructs;

public class Gpubin
{
    public Dictionary<int, string> BoneTable { get; set; }
    public IEnumerable<GpubinMesh> Meshes { get; set; }
    public Dictionary<uint, string> Parts { get; set; }
}

public class PartsLayer
{
    public string Name { get; set; }
    public List<uint> Faces { get; set; }
}

public class GpubinMesh
{
    public string Name { get; set; }
    public uint[,] FaceIndices { get; set; }
    public List<Vector3> VertexPositions { get; set; } = new();
    public List<Normal> Normals { get; set; } = new();
    public List<Normal> Tangents { get; set; } = new();
    public List<UVMap32> UVMaps { get; set; } = new();
    public List<ColorMap> ColorMaps { get; set; } = new();
    public List<List<ushort[]>> WeightIndices { get; set; } = new();
    public List<List<int[]>> WeightValues { get; set; } = new();
    public MaterialData Material { get; set; }
    public BlenderMaterialData BlenderMaterial { get; set; }
    public List<MeshPart> MeshParts { get; set; }
    public List<PartsLayer> PartsLayers { get; set; }

    public void UpdateForPartsSystem()
    {
        var faces = new Dictionary<uint, uint[]>();
        for (var i = 0u; i < FaceIndices.Length / 3; i++)
        {
            var tri = new uint[3];
            for (var j = 0; j < 3; j++)
            {
                tri[j] = FaceIndices[i, j];
            }

            faces.Add(i, tri);
        }

        var partsBase = PartsLayers.FirstOrDefault(p => p.Name == "Parts_Base");
        if (partsBase == null)
        {
            partsBase = new PartsLayer {Name = "Parts_Base", Faces = new List<uint>()};
            PartsLayers.Add(partsBase);
        }

        foreach (var (index, _) in faces)
        {
            if (!PartsLayers.Any(p => p.Faces.Any(f => f == index)))
            {
                partsBase.Faces.Add(index);
            }
        }

        var ordered = faces.OrderBy(kvp => partsBase.Faces.Any(f => f == kvp.Key));
        foreach (var layer in PartsLayers.Where(p => p != partsBase))
        {
            ordered = ordered.ThenBy(kvp => layer.Faces.Any(f => f == kvp.Key));
        }

        var result = ordered.Select(kvp => (Index: kvp.Key, VertexIndices: kvp.Value)).ToList();

        MeshParts = new List<MeshPart>();
        foreach (var layer in PartsLayers.Where(p => p.Faces.Count > 0))
        {
            MeshParts.Add(new MeshPart
            {
                StartIndex = (uint)result.IndexOf(result.FirstOrDefault(r => layer.Faces.Any(f => f == r.Index))) * 3u,
                IndexCount = (uint)result.Count(r => layer.Faces.Contains(r.Index)) * 3u,
                PartsId = PartsId.Dictionary[layer.Name]
            });
        }

        for (var i = 0; i < result.Count; i++)
        {
            for (var j = 0; j < 3; j++)
            {
                FaceIndices[i, j] = result[i].VertexIndices[j];
            }
        }
    }
}

public class BlenderMaterialData
{
    public string Hash { get; set; }
    public string Name { get; set; }
    public float[] UVScale { get; set; }
    public float[] DetailUVScale { get; set; }
    public IEnumerable<BlenderTextureData> Textures { get; set; }
}

public class BlenderTextureData
{
    public string Hash { get; set; }
    public string Name { get; set; }
    public string Slot { get; set; }
    public string Path { get; set; }
    public string Uri { get; set; }
}

public class MaterialData
{
    public string Id { get; set; }
    public int WeightLimit { get; set; }
    public Dictionary<string, float[]> Inputs { get; set; }
    public Dictionary<string, string> Textures { get; set; }
    public List<TextureData> TextureData { get; set; } = new();
}

public class TextureData
{
    public string Id { get; set; }
    public string Uri { get; set; }
    public byte[] Data { get; set; }
}

public static class PartsId
{
    public static Dictionary<string, uint> Dictionary { get; set; } = new()
    {
        {"Parts_Shell_00", 318772505},
        {"Parts_Connectb_00", 318772506},
        {"Parts_Connect_01", 318772507},
        {"Parts_RoofCnt_00", 318772508},
        {"Parts_Chair_00", 318772509},
        {"Parts_Wheel_00", 318772510},
        {"Parts_Shell_01", 318772511},
        {"Parts_RoofCnt_01", 318772512},
        {"Parts_Connectb_01", 318772513},
        {"Parts_Connect_02", 318772514},
        {"Parts_Chair_01", 318772515},
        {"Parts_Connectb_03", 318772516},
        {"Parts_Connect_03", 318772517},
        {"Parts_RoofCnt_02", 318772518},
        {"Parts_Wheel_02", 318772519},
        {"Parts_Wheel_01", 318772520},
        {"Parts_Shell_03", 318772521},
        {"Parts_Larm", 318772522},
        {"Parts_Wheel_04", 318772534},
        {"Parts_Wheel_03", 318772535},
        {"pr08_025", 318772539},
        {"pr08_026", 318772540},
        {"pr08_027", 318772541},
        {"pr08_028", 318772542},
        {"pr08_029", 318772543},
        {"Parts_Face1", 318772562},
        {"Parts_VFX", 318772578},
        {"Parts_LGrove", 318772591},
        {"Parts_RGrove", 318772592},
        {"Parts_OffGrove", 318772593},
        {"Parts_GloveA", 318772594},
        {"Parts_GloveB", 318772595},
        {"Parts_Shield", 318772612},
        {"Parts_Propeller_L", 318772613},
        {"Parts_Propeller_R", 318772614},
        {"Parts_Gun_R", 318772615},
        {"Parts_Hat", 318772632},
        {"Parts_base_01", 318772635},
        {"Parts_arm_knee_01", 318772636},
        {"Parts_arm_knee_02", 318772637},
        {"Parts_arm_knee_03", 318772638},
        {"Parts_arm_gear_01", 318772639},
        {"Parts_arm_gear_02", 318772640},
        {"Parts_arm_gear_03", 318772641},
        {"Parts_arm_gear_04", 318772642},
        {"Parts_arm_gear_05", 318772643},
        {"Parts_arm_gear_06", 318772644},
        {"Parts_Wing1", 318772645},
        {"Parts_Mh_Pauldrons_00", 318772646},
        {"Parts_Mh_Pauldrons_01", 318772647},
        {"Parts_Mh_Waistband_00", 318772648},
        {"Parts_Mh_Waistband_01", 318772649},
        {"Parts_Mh_Waistband_02", 318772650},
        {"Parts_Damage", 318772676},
        {"Parts_NODamage", 318772677},
        {"Parts_glasses", 318772694},
        {"Parts_Drool_a", 318772701},
        {"Parts_Drool_b", 318772702},
        {"parts_hide_shoes", 318772712},
        {"parts_hide_globe", 318772713},
        {"parts_hide_pants", 318772715},
        {"parts_hide_longshoes", 318772716},
        {"parts_hide_belt", 318772717},
        {"parts_hide_longbelt", 318772718},
        {"Parts_Rations_B", 318772732},
        {"Parts_Rations_A", 318772733},
        {"Parts_base", 318770502},
        {"Parts_Main", 318770503},
        {"Parts_Base", 318770505},
        {"Parts_Heart", 318770507},
        {"Parts_Hip", 318770508},
        {"Parts_L_Arm", 318770509},
        {"Parts_R_Arm", 318770510},
        {"Parts_Body", 318770521},
        {"Parts_Head", 318770522},
        {"parts_N_top_1", 318770526},
        {"parts_N_top_2", 318770527},
        {"parts_N_top_3", 318770528},
        {"parts_N_top_4", 318770529},
        {"parts_N_top_5", 318770530},
        {"parts_N_top_6", 318770531},
        {"parts_N_top_7", 318770532},
        {"parts_N_top_8", 318770533},
        {"parts_S_top_1", 318770534},
        {"parts_S_top_2", 318770535},
        {"parts_S_top_3", 318770536},
        {"parts_S_top_4", 318770537},
        {"parts_S_top_5", 318770538},
        {"parts_S_top_6", 318770539},
        {"parts_S_top_7", 318770540},
        {"parts_E_top_1", 318770541},
        {"parts_E_top_2", 318770542},
        {"parts_E_top_3", 318770543},
        {"parts_E_top_4", 318770544},
        {"parts_E_top_5", 318770545},
        {"parts_W_top_1", 318770546},
        {"parts_W_top_2", 318770547},
        {"parts_W_top_3", 318770548},
        {"parts_W_top_4", 318770549},
        {"parts_W_top_5", 318770550},
        {"Parts_SafetyA", 318772788},
        {"parts_W_top_6", 318770551},
        {"Parts_Pin", 318772789},
        {"parts_W_top_7", 318770552},
        {"Parts_SafetyB", 318772790},
        {"parts_W_top_8", 318770553},
        {"Parts_Lever", 318772791},
        {"parts_N_bottom_1", 318770554},
        {"parts_N_bottom_2", 318770555},
        {"parts_N_bottom_3", 318770556},
        {"parts_N_bottom_4", 318770557},
        {"parts_N_bottom_5", 318770558},
        {"parts_N_bottom_6", 318770559},
        {"Parts_Masks_A", 318772797},
        {"parts_N_bottom_7", 318770560},
        {"Parts_Masks_B", 318772798},
        {"parts_N_bottom_8", 318770561},
        {"Parts_Righthand_A", 318772799},
        {"parts_S_bottom_1", 318770562},
        {"Parts_Righthand_B", 318772800},
        {"parts_S_bottom_2", 318770563},
        {"parts_S_bottom_3", 318770564},
        {"parts_S_bottom_4", 318770565},
        {"parts_S_bottom_5", 318770566},
        {"parts_S_bottom_6", 318770567},
        {"parts_S_bottom_7", 318770568},
        {"parts_E_bottom_1", 318770569},
        {"parts_E_bottom_2", 318770570},
        {"parts_E_bottom_3", 318770571},
        {"parts_E_bottom_4", 318770572},
        {"parts_E_bottom_5", 318770573},
        {"parts_W_bottom_1", 318770574},
        {"parts_W_bottom_2", 318770575},
        {"parts_W_bottom_3", 318770576},
        {"Parts_Boots_R", 318772814},
        {"parts_W_bottom_4", 318770577},
        {"Parts_Boots_L", 318772815},
        {"parts_W_bottom_5", 318770578},
        {"parts_W_bottom_6", 318770579},
        {"parts_W_bottom_7", 318770580},
        {"parts_W_bottom_8", 318770581},
        {"parts_058", 318770582},
        {"parts_059", 318770583},
        {"parts_060", 318770584},
        {"parts_061", 318770585},
        {"parts_062", 318770586},
        {"parts_063", 318770587},
        {"parts_064", 318770588},
        {"parts_065", 318770589},
        {"parts_066", 318770590},
        {"parts_067", 318770591},
        {"parts_068", 318770592},
        {"parts_069", 318770593},
        {"parts_070", 318770594},
        {"parts_071", 318770595},
        {"parts_072", 318770596},
        {"parts_073", 318770597},
        {"parts_074", 318770598},
        {"parts_075", 318770599},
        {"parts_076", 318770600},
        {"parts_077", 318770601},
        {"parts_078", 318770602},
        {"parts_079", 318770603},
        {"parts_080", 318770604},
        {"parts_081", 318770605},
        {"parts_082", 318770606},
        {"parts_083", 318770607},
        {"parts_084", 318770608},
        {"parts_085", 318770609},
        {"parts_086", 318770610},
        {"parts_087", 318770611},
        {"parts_088", 318770612},
        {"parts_089", 318770613},
        {"parts_090", 318770614},
        {"parts_091", 318770615},
        {"parts_092", 318770616},
        {"parts_093", 318770617},
        {"parts_094", 318770618},
        {"parts_095", 318770619},
        {"parts_096", 318770620},
        {"parts_097", 318770621},
        {"parts_098", 318770622},
        {"parts_099", 318770623},
        {"parts_0100", 318770624},
        {"parts_0101", 318770625},
        {"parts_0102", 318770626},
        {"parts_0103", 318770627},
        {"Parts_Gun", 318772865},
        {"parts_0104", 318770628},
        {"parts_0105", 318770629},
        {"parts_0106", 318770630},
        {"parts_0123", 318770631},
        {"parts_0124", 318770632},
        {"parts_0125", 318770633},
        {"parts_0127", 318770634},
        {"parts_0128", 318770635},
        {"parts_0129", 318770636},
        {"parts_0130", 318770637},
        {"parts_0131", 318770638},
        {"parts_0132", 318770639},
        {"parts_0133", 318770640},
        {"Parts_Lefthand", 318772878},
        {"parts_0134", 318770641},
        {"parts_0135", 318770642},
        {"parts_0136", 318770643},
        {"parts_0137", 318770644},
        {"parts_0138", 318770645},
        {"parts_0139", 318770646},
        {"parts_0140", 318770647},
        {"parts_0141", 318770648},
        {"parts_0142", 318770649},
        {"parts_0143", 318770650},
        {"parts_0144", 318770651},
        {"parts_0145", 318770652},
        {"parts_0146", 318770653},
        {"parts_0147", 318770654},
        {"parts_0148", 318770655},
        {"parts_0149", 318770656},
        {"parts_0150", 318770657},
        {"parts_0151", 318770658},
        {"parts_0152", 318770659},
        {"parts_0153", 318770660},
        {"parts_0154", 318770661},
        {"parts_0155", 318770662},
        {"parts_0156", 318770663},
        {"parts_0157", 318770664},
        {"parts_0158", 318770665},
        {"parts_0159", 318770666},
        {"parts_0160", 318770667},
        {"Parts_Add1", 318772905},
        {"parts_0161", 318770668},
        {"parts_0162", 318770669},
        {"parts_0163", 318770670},
        {"parts_0164", 318770671},
        {"parts_0165", 318770672},
        {"parts_0166", 318770673},
        {"parts_0167", 318770674},
        {"parts_0168", 318770675},
        {"parts_0169", 318770676},
        {"parts_0170", 318770677},
        {"parts_0171", 318770678},
        {"parts_0172", 318770679},
        {"parts_0173", 318770680},
        {"parts_0174", 318770681},
        {"parts_0175", 318770682},
        {"parts_0176", 318770683},
        {"parts_0177", 318770684},
        {"parts_0178", 318770685},
        {"parts_0179", 318770686},
        {"parts_0180", 318770687},
        {"parts_0181", 318770688},
        {"parts_0182", 318770689},
        {"parts_0183", 318770690},
        {"parts_0184", 318770691},
        {"parts_0185", 318770692},
        {"parts_0186", 318770693},
        {"parts_0187", 318770694},
        {"parts_0188", 318770695},
        {"parts_0189", 318770696},
        {"parts_0190", 318770697},
        {"parts_0191", 318770698},
        {"parts_0192", 318770699},
        {"parts_0193", 318770700},
        {"parts_0194", 318770701},
        {"parts_0195", 318770702},
        {"parts_0196", 318770703},
        {"parts_0197", 318770704},
        {"parts_0198", 318770705},
        {"parts_0199", 318770706},
        {"parts_0200", 318770707},
        {"parts_0201", 318770708},
        {"parts_0202", 318770709},
        {"parts_0203", 318770710},
        {"parts_0204", 318770711},
        {"Parts_Body_Chest", 318772949},
        {"parts_0205", 318770712},
        {"Parts_Body_Finger", 318772950},
        {"parts_0206", 318770713},
        {"Parts_Body_Hand", 318772951},
        {"parts_0207", 318770714},
        {"Parts_Body_ForeArm", 318772952},
        {"parts_0208", 318770715},
        {"Parts_Body_UpArm", 318772953},
        {"parts_0209", 318770716},
        {"Parts_Body_Shoulder", 318772954},
        {"parts_0210", 318770717},
        {"Parts_Body_Body", 318772955},
        {"parts_0212", 318770718},
        {"Parts_Body_UpperLeg", 318772956},
        {"parts_0213", 318770719},
        {"Parts_Body_ForeLeg", 318772957},
        {"parts_0214", 318770720},
        {"Parts_Body_Foot", 318772958},
        {"parts_0126", 318770721},
        {"Parts_Body_Toes", 318772959},
        {"Parts_horn_a", 318770727},
        {"Parts_horn_b", 318770728},
        {"Parts_horn_c", 318770729},
        {"Parts_Shirt_Inner_sleeves", 318772967},
        {"Parts_Shirt_Inner_sleeves1", 318772968},
        {"Parts_SmallGun_FLR", 318772969},
        {"Parts_Hair", 318770733},
        {"Parts_Cloth", 318770734},
        {"Parts_Hair00", 318770736},
        {"Parts_Hair01", 318770737},
        {"Parts_Acce", 318772979},
        {"parts_0282", 318770754},
        {"parts_0283", 318770755},
        {"parts_0292", 318770756},
        {"parts_0293", 318770757},
        {"parts_0295", 318770758},
        {"parts_0296", 318770759},
        {"parts_0297", 318770760},
        {"parts_0298", 318770761},
        {"parts_0300", 318770762},
        {"parts_0301", 318770763},
        {"parts_0302", 318770764},
        {"parts_0347", 318770765},
        {"parts_0348", 318770766},
        {"parts_0349", 318770767},
        {"parts_0351", 318770768},
        {"parts_0352", 318770769},
        {"parts_0353", 318770770},
        {"parts_0354", 318770771},
        {"parts_0355", 318770772},
        {"parts_0356", 318770773},
        {"parts_0357", 318770774},
        {"parts_0358", 318770775},
        {"parts_0359", 318770776},
        {"parts_0360", 318770777},
        {"parts_shadow_on", 318770781},
        {"parts_hide_tops_end", 318773020},
        {"parts_hide_sleeve", 318773021},
        {"Parts_a", 318770808},
        {"Parts_Acce1", 318773058},
        {"Parts_Acce3", 318773059},
        {"Parts_Acce_glass_01_org", 318773061},
        {"Parts_Acce4", 318773062},
        {"Parts_Face3", 318773063},
        {"parts_hide_niflneck", 318773072},
        {"Parts_NeckEyeglass", 318770841},
        {"Parts_FaceEyeglass", 318770842},
        {"Parts_Body_Wrist", 318773089},
        {"Parts_Body_Knee", 318773090},
        {"Parts_Horn", 318770857},
        {"Parts_c", 318770859},
        {"Parts_Face", 318770860},
        {"Parts_Face4", 318773099},
        {"Parts_Inside2", 318773102},
        {"Parts_Inside3", 318773103},
        {"parts_01_LOD0", 318773104},
        {"Parts_body", 318770868},
        {"parts_01_LOD1", 318773105},
        {"parts_01_LOD2", 318773106},
        {"parts_04_LOD0", 318773107},
        {"parts_04_LOD1", 318773108},
        {"parts_04_LOD2", 318773109},
        {"TERRAIN_HIGH", 318770877},
        {"TERRAIN_LOW", 318770878},
        {"Parts_hair", 318770902},
        {"Parts_Hair02", 318770906},
        {"Parts_Hair03", 318770907},
        {"Parts_Heart1", 318770910},
        {"Parts_Glove", 318770917},
        {"Parts_Hand", 318770918},
        {"Parts_FaceMeshB", 318770927},
        {"Parts_Sword", 318770954},
        {"Parts_A", 318770970},
        {"Parts_Wing", 318770973},
        {"parts_sharp", 318768754},
        {"Parts_Cape", 318773233},
        {"parts_LOD", 318773249},
        {"parts_food", 318771019},
        {"parts_load", 318773261},
        {"Parts_Flag00", 318773269},
        {"Parts_Mouth", 318773279},
        {"Parts_Wear", 318773280},
        {"Parts_B", 318771062},
        {"Parts_Cap_hair_group", 318771095},
        {"Parts_Hide", 318773338},
        {"Parts_hair00", 318771216},
        {"Parts_C", 318771222},
        {"Parts_D", 318771223},
        {"Parts_HeadArmor", 318771225},
        {"Parts_Spear", 318771227},
        {"Parts_Sheath", 318771279},
        {"Parts_Cap", 318771284},
        {"Parts_Stick", 318771314},
        {"Parts_Bodys", 318771324},
        {"Parts_Other", 318771325},
        {"Parts_Funnel", 318771355},
        {"Parts_FitSword", 318771424},
        {"Parts_DrawSword", 318771425},
        {"Parts_Tie", 318771437},
        {"Sail", 318771446},
        {"Parts_inside", 318771447},
        {"Parts_Saliva", 318771450},
        {"Parts_Craft", 318771452},
        {"Parts_Inside", 318771470},
        {"Parts_Anchor", 318771477},
        {"parts_A_LOD0", 318771478},
        {"parts_B_LOD0", 318771479},
        {"Parts_Destroy01", 318771482},
        {"Parts_Destroy02", 318771483},
        {"Parts_Destroy03", 318771484},
        {"Parts_Destroy04", 318771485},
        {"Parts_Destroy05", 318771486},
        {"Parts_Destroy06", 318771487},
        {"Parts_Destroy07", 318771488},
        {"Parts_Destroy08", 318771489},
        {"Parts_L_Wire", 318771496},
        {"Parts_LegMissile_L", 318771498},
        {"Parts_LegMissile_R", 318771499},
        {"Parts_Jacket", 318771510},
        {"Parts_Cloth00", 318771511},
        {"Parts_Cloth01", 318771512},
        {"Parts_outside", 318771525},
        {"Parts_wheel", 318771526},
        {"parts_metal", 318771528},
        {"Parts_Destroy", 318771542},
        {"Parts_Lasersight_L", 318771544},
        {"Parts_Lasersight_R", 318771545},
        {"Parts_Chainsaw_R", 318771546},
        {"Parts_Gunhand_L", 318771547},
        {"Parts_Missilepod_L", 318771548},
        {"Parts_Missilepod_R", 318771549},
        {"Parts_SmallGun_F", 318771550},
        {"Parts_SmallGun_B", 318771551},
        {"Parts_Hatch", 318771553},
        {"Parts_Inner", 318771557},
        {"Parts_Seat", 318771558},
        {"Parts_Interior", 318771562},
        {"Parts_in_mesh", 318771566},
        {"parts_base", 318767105},
        {"Parts_Grass", 318771599},
        {"Parts_Chair", 318771604},
        {"Parts_Wheel", 318771605},
        {"Parts_Connect", 318771606},
        {"Parts_Shell", 318771607},
        {"Parts_Glass", 318771608},
        {"Parts_Window", 318771609},
        {"slope", 318771610},
        {"Parts_Body_lod0", 318771611},
        {"Parts_Body_lod2", 318771613},
        {"Parts_Body_lod3", 318771614},
        {"Parts_Body_lod4", 318771615},
        {"Parts_Interior_lod0", 318771616},
        {"Parts_Interiorl_lod1", 318771617},
        {"Parts_Interior_lod2", 318771618},
        {"Parts_Interior_lod3", 318771619},
        {"Parts_Interior_lod4", 318771620},
        {"Parts_gun", 318771624},
        {"parts_joint", 318771646},
        {"parts_02", 318771647},
        {"parts_03", 318771648},
        {"parts_04", 318771649},
        {"parts_05", 318771650},
        {"parts_06", 318771651},
        {"parts_07", 318771652},
        {"parts_08", 318771653},
        {"parts_09", 318771654},
        {"parts_010", 318771655},
        {"parts_011", 318771656},
        {"parts_013", 318771657},
        {"parts_014", 318771658},
        {"parts_015", 318771659},
        {"parts_016", 318771660},
        {"parts_017", 318771661},
        {"parts_018", 318771662},
        {"parts_019", 318771663},
        {"parts_020", 318771664},
        {"parts_021", 318771665},
        {"parts_022", 318771666},
        {"parts_023", 318771667},
        {"parts_024", 318771668},
        {"parts_025", 318771669},
        {"parts_026", 318771670},
        {"parts_027", 318771671},
        {"parts_028", 318771672},
        {"parts_029", 318771673},
        {"parts_030", 318771674},
        {"parts_031", 318771675},
        {"parts_032", 318771676},
        {"parts_033", 318771677},
        {"parts_034", 318771678},
        {"parts_035", 318771679},
        {"parts_036", 318771680},
        {"parts_037", 318771681},
        {"parts_038", 318771682},
        {"parts_039", 318771683},
        {"parts_040", 318771684},
        {"parts_041", 318771685},
        {"parts_042", 318771686},
        {"parts_043", 318771687},
        {"parts_044", 318771688},
        {"parts_045", 318771689},
        {"parts_046", 318771690},
        {"parts_047", 318771691},
        {"parts_048", 318771692},
        {"parts_049", 318771693},
        {"parts_050", 318771694},
        {"parts_051", 318771695},
        {"parts_052", 318771696},
        {"parts_053", 318771697},
        {"parts_054", 318771698},
        {"parts_055", 318771699},
        {"parts_056", 318771700},
        {"parts_057", 318771701},
        {"Parts_GlassA", 318771712},
        {"Parts_GlassB", 318771713},
        {"Parts_Heavy", 318771716},
        {"Parts_Light", 318771717},
        {"Parts_NoCap_hair", 318771718},
        {"Parts_Creature", 318771727},
        {"Parts_Body_lod1", 318771731},
        {"Parts_Body_lod5", 318771732},
        {"Parts_Body_lod6", 318771733},
        {"Parts_Interior_lod5", 318771734},
        {"Parts_Interior_lod6", 318771735},
        {"Parts_Broken", 318771736},
        {"parts_base1", 318767281},
        {"Parts_GlassC", 318771797},
        {"parts_LOD0", 318771801},
        {"parts_LOD1", 318771802},
        {"parts_LOD2", 318771803},
        {"Parts_Chip", 318771812},
        {"Parts_Bottle", 318771813},
        {"Parts_Knife", 318771814},
        {"Parts_Pan", 318771815},
        {"Parts_Can", 318771816},
        {"Parts_Food", 318771817},
        {"Parts_Fruit", 318771818},
        {"Parts_other", 318771819},
        {"parts_Wall", 318771874},
        {"parts_b", 318767401},
        {"Parts_Connect_lod0", 318771881},
        {"Parts_Connect_lod1", 318771882},
        {"Parts_Connect_lod2", 318771883},
        {"Parts_Connect_lod3", 318771884},
        {"Parts_Connect_lod4", 318771885},
        {"Parts_RoofCnt", 318771905},
        {"Parts_glass", 318771907},
        {"Parts_1", 318771913},
        {"Parts_FrontHair", 318771918},
        {"Parts_Wep", 318771934},
        {"Parts_horn_p1", 318771936},
        {"Parts_Destroy_p1", 318771937},
        {"Parts_Destroy_p2", 318771938},
        {"Parts_Destroy_p3", 318771939},
        {"Parts_Open", 318771957},
        {"Parts_Close", 318771958},
        {"Parts_Base_A", 318771970},
        {"Parts_Base_B", 318771971},
        {"Parts_ArtificialHand", 318771972},
        {"Parts_HideArm", 318771973},
        {"Parts_Spear1", 318771976},
        {"Parts_Destroy09", 318771982},
        {"Parts_Destroy10", 318771983},
        {"Parts_HairA", 318771984},
        {"Parts_HairB", 318771985},
        {"Parts_Monster", 318772003},
        {"Parts_Fan", 318772014},
        {"Parts_Ring", 318772016},
        {"Parts_HideHair", 318772043},
        {"Parts_Crack1", 318772049},
        {"parts_1F_a4_LOD0", 318772056},
        {"parts_1F_a4_LOD1", 318772057},
        {"parts_1F_a4_LOD2", 318772058},
        {"Parts_Add", 318772078},
        {"parts_01", 318769848},
        {"Parts_wire", 318772086},
        {"Parts_SwordA", 318772091},
        {"Parts_SwordB", 318772092},
        {"Parts_SwordC", 318772093},
        {"Parts_SwordD", 318772094},
        {"Parts_SwordE", 318772095},
        {"Parts_SwordF", 318772096},
        {"Parts_chair_mid", 318772098},
        {"Parts_L_Nails", 318772102},
        {"Parts_R_Nails", 318772103},
        {"parts_b_LOD1", 318772107},
        {"parts_a_LOD1", 318772108},
        {"parts_b_LOD2", 318772109},
        {"parts_a_LOD2", 318772110},
        {"parts_b_LOD3", 318772111},
        {"parts_a_LOD3", 318772112},
        {"parts_b_LOD4", 318772113},
        {"parts_a_LOD4", 318772114},
        {"parts_line", 318769892},
        {"Parts_Tear", 318772134},
        {"pipe_open", 318772138},
        {"pipe_close", 318772139},
        {"parts_dress_normal", 318772144},
        {"parts_dress_break", 318772145},
        {"Parts_Shadow", 318772147},
        {"Parts_Base_We07_200", 318772148},
        {"parts_LOD3", 318772168},
        {"Parts_Arm", 318772207},
        {"Parts_Symbal", 318772210},
        {"Parts_DamageHair", 318772217},
        {"Parts_face", 318772221},
        {"Parts_middle_l", 318772222},
        {"Parts_middle_r", 318772223},
        {"Parts_under_l", 318772224},
        {"Parts_under_r", 318772225},
        {"Parts_up_l", 318772226},
        {"Parts_up_r", 318772227},
        {"Parts_body01", 318772228},
        {"Parts_wing01", 318772229},
        {"Parts_body02", 318772230},
        {"Parts_wing02", 318772231},
        {"Parts_body03", 318772232},
        {"Parts_wing03", 318772233},
        {"Parts_body04", 318772234},
        {"Parts_wing04", 318772235},
        {"Parts_body05", 318772236},
        {"Parts_wing05", 318772237},
        {"Parts_body06", 318772238},
        {"Parts_wing06", 318772239},
        {"Parts_body07", 318772240},
        {"Parts_wing07", 318772241},
        {"Parts_body08", 318772242},
        {"Parts_wing08", 318772243},
        {"Parts_body09", 318772244},
        {"Parts_wing09", 318772245},
        {"Parts_body10", 318772246},
        {"Parts_wing10", 318772247},
        {"parts_a", 318767805},
        {"Parts_Destroy1", 318772305},
        {"Parts_Destroy2", 318772306},
        {"Parts_Destroy3", 318772307},
        {"Parts_Destroy4", 318772308},
        {"Parts_F", 318772327},
        {"Parts_M", 318772328},
        {"Parts_CapHair", 318772332},
        {"Parts_Destroy5", 318772346},
        {"Parts_Destroy6", 318772347},
        {"Parts_Axe", 318772374},
        {"Parts_RoofCnt1", 318772421},
        {"Parts_Connect1", 318772422},
        {"Parts_RoofCnt2", 318772423},
        {"Parts_RoofCnt3", 318772424}
    };
}