Exemplo n.º 1
0
        private NewMesh LoadArmorMesh(IBinder partsbnd)
        {
            List <TPF> tpfs  = new List <TPF>();
            FLVER2     flver = null;

            foreach (var f in partsbnd.Files)
            {
                string nameCheck = f.Name.ToLower();
                if (nameCheck.EndsWith(".tpf") || TPF.Is(f.Bytes))
                {
                    tpfs.Add(TPF.Read(f.Bytes));
                }
                else if (flver == null && nameCheck.EndsWith(".flver") || FLVER2.Is(f.Bytes))
                {
                    flver = FLVER2.Read(f.Bytes);
                }
            }

            foreach (var tpf in tpfs)
            {
                TexturePool.AddTpf(tpf);
            }

            NewMesh mesh = null;

            if (flver != null)
            {
                mesh = new NewMesh(flver, false, boneIndexRemap);
            }
            Scene.RequestTextureLoad();

            return(mesh);
        }
Exemplo n.º 2
0
        private void LoadFLVER2(FLVER2 flver, bool useSecondUV, int baseDmyPolyID = 0, bool ignoreStaticTransforms = false)
        {
            Type = ModelType.ModelTypeFlver;

            Skeleton = new NewAnimSkeleton(this, flver.Bones);

            MainMesh = new NewMesh(flver, useSecondUV, null, ignoreStaticTransforms);

            Bounds = MainMesh.Bounds;

            DummyPolyMan.AddAllDummiesFromFlver(flver);

            //DEBUG//
            //Console.WriteLine($"{flver.Meshes[0].DefaultBoneIndex}");
            //Console.WriteLine();
            //Console.WriteLine();
            //foreach (var mat in flver.Materials)
            //{
            //    Console.WriteLine($"{mat.Name}: {mat.MTD}");
            //}
            /////////
        }
Exemplo n.º 3
0
 public void LoadArmorPartsbnd(IBinder partsbnd, EquipSlot slot)
 {
     if (slot == EquipSlot.Head)
     {
         HeadMesh?.Dispose();
         HeadMesh = LoadArmorMesh(partsbnd);
     }
     else if (slot == EquipSlot.Body)
     {
         BodyMesh?.Dispose();
         BodyMesh = LoadArmorMesh(partsbnd);
     }
     else if (slot == EquipSlot.Arms)
     {
         ArmsMesh?.Dispose();
         ArmsMesh = LoadArmorMesh(partsbnd);
     }
     else if (slot == EquipSlot.Legs)
     {
         LegsMesh?.Dispose();
         LegsMesh = LoadArmorMesh(partsbnd);
     }
 }