// ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            ushort numCurve        = loader.ReadUInt16();
            ushort numKeyShapeAnim = loader.ReadUInt16();

            BeginCurve        = loader.ReadInt32();
            BeginKeyShapeAnim = loader.ReadInt32();
            Name = loader.LoadString();
            KeyShapeAnimInfos = loader.LoadList <KeyShapeAnimInfo>(numKeyShapeAnim);
            Curves            = loader.LoadList <AnimCurve>(numCurve);
            BaseDataList      = loader.LoadCustom(() => loader.ReadSingles(numKeyShapeAnim - 1)); // Without base shape.
        }
Ejemplo n.º 2
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            ushort numPatAnim = loader.ReadUInt16();
            ushort numCurve   = loader.ReadUInt16();

            BeginCurve       = loader.ReadInt32();
            BeginPatAnim     = loader.ReadInt32();
            Name             = loader.LoadString();
            PatternAnimInfos = loader.LoadList <PatternAnimInfo>(numPatAnim);
            Curves           = loader.LoadList <AnimCurve>(numCurve);
            BaseDataList     = loader.LoadCustom(() => loader.ReadUInt16s(numPatAnim));
        }
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            ushort numAnimParam = loader.ReadUInt16();
            ushort numCurve     = loader.ReadUInt16();
            ushort numConstant  = loader.ReadUInt16();

            loader.Seek(2);
            BeginCurve     = loader.ReadInt32();
            BeginParamAnim = loader.ReadInt32();
            Name           = loader.LoadString();
            ParamAnimInfos = loader.LoadList <ParamAnimInfo>(numAnimParam);
            Curves         = loader.LoadList <AnimCurve>(numCurve);
            Constants      = loader.LoadCustom(() => loader.ReadAnimConstants(numConstant));
        }
        void IResData.Load(ResFileLoader loader)
        {
            if (loader.ResFile.Version >= 0x02040000)
            {
                loader.CheckSignature(_signature);
                Name  = loader.LoadString();
                Path  = loader.LoadString();
                Flags = loader.ReadEnum <ShaderParamAnimFlags>(true);

                ushort numMatAnim = 0;
                if (loader.ResFile.Version >= 0x03040000)
                {
                    FrameCount = loader.ReadInt32();
                    numMatAnim = loader.ReadUInt16();
                    ushort numUserData  = loader.ReadUInt16();
                    int    numParamAnim = loader.ReadInt32();
                    int    numCurve     = loader.ReadInt32();
                    BakedSize = loader.ReadUInt32();
                }
                else
                {
                    FrameCount = loader.ReadUInt16();
                    numMatAnim = loader.ReadUInt16();
                    unk        = loader.ReadUInt32();
                    int numCurve = loader.ReadInt32();
                    BakedSize = loader.ReadUInt32();
                    int padding2 = loader.ReadInt32();
                }
                BindModel           = loader.Load <Model>();
                BindIndices         = loader.LoadCustom(() => loader.ReadUInt16s(numMatAnim));
                ShaderParamMatAnims = loader.LoadList <ShaderParamMatAnim>(numMatAnim);
                UserData            = loader.LoadDict <UserData>();
            }
            else
            {
                Flags      = loader.ReadEnum <ShaderParamAnimFlags>(true);
                FrameCount = loader.ReadInt16();
                ushort numMatAnim  = loader.ReadUInt16();
                ushort numUserData = loader.ReadUInt16();
                ushort unk         = loader.ReadUInt16();
                BakedSize           = loader.ReadUInt32();
                Name                = loader.LoadString();
                Path                = loader.LoadString();
                BindModel           = loader.Load <Model>();
                BindIndices         = loader.LoadCustom(() => loader.ReadUInt16s(numMatAnim));
                ShaderParamMatAnims = loader.LoadList <ShaderParamMatAnim>(numMatAnim);
            }
        }
Ejemplo n.º 5
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Name   = loader.LoadString();
            Path   = loader.LoadString();
            _flags = loader.ReadUInt16();
            ushort numUserData = loader.ReadUInt16();

            FrameCount = loader.ReadInt32();
            ushort numAnim  = loader.ReadUInt16();
            ushort numCurve = loader.ReadUInt16();

            BakedSize    = loader.ReadUInt32();
            BindModel    = loader.Load <Model>();
            BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numAnim));
            Names        = loader.LoadCustom(() => loader.LoadStrings(numAnim)); // Offset to name list.
            Curves       = loader.LoadList <AnimCurve>(numCurve);
            BaseDataList = loader.LoadCustom(() =>
            {
                bool[] baseData = new bool[numAnim];
                int i           = 0;
                while (i < numAnim)
                {
                    byte b = loader.ReadByte();
                    for (int j = 0; j < 8 && i < numAnim; j++)
                    {
                        baseData[i++] = b.GetBit(j);
                    }
                }
                return(baseData);
            });
            UserData = loader.LoadDict <UserData>();
        }
Ejemplo n.º 6
0
        // TODO: Methods to retrieve the strongly-typed shader param value.

        // ---- METHODS ------------C:\Users\Nathan\Documents\GitHub\NintenTools.Bfres-master\NintenTools.Bfres\src\Syroot.NintenTools.Bfres\ExternalFile\------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            Type = loader.ReadEnum <ShaderParamType>(true);
            byte sizData = loader.ReadByte();

            if (sizData != (byte)DataSize && sizData > DataSize)
            {
                UsePadding    = true;
                PaddingLength = sizData - (byte)DataSize;
            }

            DataOffset = loader.ReadUInt16();
            offset     = loader.ReadInt32(); // Uniform variable offset.
            if (loader.ResFile.Version >= 0x03040000)
            {
                callbackPointer = loader.ReadUInt32();
                DependedIndex   = loader.ReadUInt16();
                DependIndex     = loader.ReadUInt16();
            }
            else if (loader.ResFile.Version >= 0x03030000 &&
                     loader.ResFile.Version < 0x03040000)
            {
                callbackPointer = loader.ReadUInt32();
                DependedIndex   = loader.ReadUInt16();
                DependIndex     = loader.ReadUInt16();
                uint FMATOffset = loader.ReadUInt32(); //Why does this have this????
            }
            Name = loader.LoadString();
        }
Ejemplo n.º 7
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            if (loader.IsSwitch)
            {
                Switch.LightAnimParser.Read((Switch.Core.ResFileSwitchLoader)loader, this);
            }
            else
            {
                Flags = loader.ReadEnum <LightAnimFlags>(true);
                ushort numUserData = loader.ReadUInt16();
                FrameCount = loader.ReadInt32();
                byte numCurve = loader.ReadByte();
                LightTypeIndex        = loader.ReadSByte();
                DistanceAttnFuncIndex = loader.ReadSByte();
                AngleAttnFuncIndex    = loader.ReadSByte();
                BakedSize             = loader.ReadUInt32();
                Name                 = loader.LoadString();
                LightTypeName        = loader.LoadString();
                DistanceAttnFuncName = loader.LoadString();
                AngleAttnFuncName    = loader.LoadString();
                Curves               = loader.LoadList <AnimCurve>(numCurve);
                BaseData             = loader.LoadCustom(() => new LightAnimData(loader, AnimatedFields));
                UserData             = loader.LoadDict <UserData>();
            }
        }
Ejemplo n.º 8
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Name       = loader.LoadString();
            Path       = loader.LoadString();
            _flags     = loader.ReadUInt32();
            FrameCount = loader.ReadInt32();
            ushort numBoneAnim = loader.ReadUInt16();
            ushort numUserData = loader.ReadUInt16();
            int    numCurve    = loader.ReadInt32();

            BakedSize    = loader.ReadUInt32();
            BoneAnims    = loader.LoadList <BoneAnim>(numBoneAnim);
            BindSkeleton = loader.Load <Skeleton>();
            BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim));
            UserData     = loader.LoadDict <UserData>();
        }
Ejemplo n.º 9
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            if (loader.ResFile.Version >= 0x02040000)
            {
                loader.CheckSignature(_signature);
                Name   = loader.LoadString();
                Path   = loader.LoadString();
                _flags = loader.ReadUInt32();

                if (loader.ResFile.Version >= 0x03040000)
                {
                    FrameCount  = loader.ReadInt32();
                    numBoneAnim = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    int    numCurve    = loader.ReadInt32();
                    BakedSize = loader.ReadUInt32();
                }
                else
                {
                    FrameCount  = loader.ReadUInt16();
                    numBoneAnim = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    ushort numCurve    = loader.ReadUInt16();
                    BakedSize = loader.ReadUInt32();
                    loader.Seek(4); //padding
                }

                BoneAnims    = loader.LoadList <BoneAnim>(numBoneAnim).ToList();
                BindSkeleton = loader.Load <Skeleton>();
                BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim));
                UserData     = loader.LoadDict <UserData>();
            }
            else
            {
                _flags      = loader.ReadUInt32();
                FrameCount  = loader.ReadUInt16();
                numBoneAnim = loader.ReadUInt16();
                ushort numUserData = loader.ReadUInt16();
                ushort numCurve    = loader.ReadUInt16();
                Name         = loader.LoadString();
                Path         = loader.LoadString();
                BoneAnims    = loader.LoadList <BoneAnim>(numBoneAnim).ToList();
                BindSkeleton = loader.Load <Skeleton>();
                BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim));
            }
        }
Ejemplo n.º 10
0
        // ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------

        internal LightAnimData(ResFileLoader loader, LightAnimField flags)
        {
            Enable       = flags.HasFlag(LightAnimField.Enable) ? loader.ReadInt32() : 0;
            Position     = flags.HasFlag(LightAnimField.Position) ? loader.ReadVector3F() : Vector3F.Zero;
            Rotation     = flags.HasFlag(LightAnimField.Rotation) ? loader.ReadVector3F() : Vector3F.Zero;
            DistanceAttn = flags.HasFlag(LightAnimField.DistanceAttn) ? loader.ReadVector2F() : Vector2F.Zero;
            AngleAttn    = flags.HasFlag(LightAnimField.AngleAttn) ? loader.ReadVector2F() : Vector2F.Zero;
            Color0       = flags.HasFlag(LightAnimField.Color0) ? loader.ReadVector3F() : Vector3F.Zero;
            Color1       = flags.HasFlag(LightAnimField.Color1) ? loader.ReadVector3F() : Vector3F.Zero;
        }
Ejemplo n.º 11
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            if (loader.IsSwitch)
            {
                Switch.VisibilityAnimParser.Read((Switch.Core.ResFileSwitchLoader)loader, this);
            }
            else
            {
                Name   = loader.LoadString();
                Path   = loader.LoadString();
                _flags = loader.ReadUInt16();
                ushort numAnim  = 0;
                ushort numCurve = 0;
                if (loader.ResFile.Version >= 0x03040000)
                {
                    ushort numUserData = loader.ReadUInt16();
                    FrameCount = loader.ReadInt32();
                    numAnim    = loader.ReadUInt16();
                    numCurve   = loader.ReadUInt16();
                    BakedSize  = loader.ReadUInt32();
                }
                else
                {
                    FrameCount = loader.ReadInt16();
                    numAnim    = loader.ReadUInt16();
                    numCurve   = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    BakedSize = loader.ReadUInt32();
                    int padding2 = loader.ReadInt16();
                }
                BindModel     = loader.Load <Model>();
                BindIndices   = loader.LoadCustom(() => loader.ReadUInt16s(numAnim));
                Names         = loader.LoadCustom(() => loader.LoadStrings(numAnim)); // Offset to name list.
                Curves        = loader.LoadList <AnimCurve>(numCurve);
                baseDataBytes = new List <byte>();
                BaseDataList  = loader.LoadCustom(() =>
                {
                    bool[] baseData = new bool[numAnim];
                    int i           = 0;
                    while (i < numAnim)
                    {
                        byte b = loader.ReadByte();
                        baseDataBytes.Add(b);
                        for (int j = 0; j < 8 && i < numAnim; j++)
                        {
                            baseData[i] = b.GetBit(j);
                        }
                        i++;
                    }
                    return(baseData);
                });
                UserData = loader.LoadDict <UserData>();
            }
        }
Ejemplo n.º 12
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            if (loader.IsSwitch)
            {
                Name = loader.LoadString();
                uint   CurveOffset             = loader.ReadOffset();
                uint   BaseDataOffset          = loader.ReadOffset();
                uint   KeyShapeAnimInfosOffset = loader.ReadOffset();
                ushort numCurve        = loader.ReadUInt16();
                ushort numKeyShapeAnim = loader.ReadUInt16();
                BeginCurve        = loader.ReadInt32();
                BeginKeyShapeAnim = loader.ReadInt32();
                loader.Seek(4); //Padding

                KeyShapeAnimInfos = loader.LoadList <KeyShapeAnimInfo>(numKeyShapeAnim, KeyShapeAnimInfosOffset);
                Curves            = loader.LoadList <AnimCurve>(numCurve, CurveOffset);
                BaseDataList      = loader.LoadCustom(() => loader.ReadSingles(numKeyShapeAnim - 1), BaseDataOffset); // Without base shape.
            }
            else
            {
                ushort numCurve;
                ushort numKeyShapeAnim;
                if (loader.ResFile.Version >= 0x03040000)
                {
                    numCurve        = loader.ReadUInt16();
                    numKeyShapeAnim = loader.ReadUInt16();
                }
                else
                {
                    numCurve        = loader.ReadByte();
                    numKeyShapeAnim = loader.ReadByte();
                    unk             = loader.ReadUInt16();
                }

                BeginCurve        = loader.ReadInt32();
                BeginKeyShapeAnim = loader.ReadInt32();
                Name = loader.LoadString();
                KeyShapeAnimInfos = loader.LoadList <KeyShapeAnimInfo>(numKeyShapeAnim);
                Curves            = loader.LoadList <AnimCurve>(numCurve);
                BaseDataList      = loader.LoadCustom(() => loader.ReadSingles(numKeyShapeAnim - 1)); // Without base shape.
            }
        }
Ejemplo n.º 13
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Name  = loader.LoadString();
            Path  = loader.LoadString();
            Flags = loader.ReadEnum <TexPatternAnimFlags>(true);
            ushort numUserData = loader.ReadUInt16();

            FrameCount = loader.ReadInt32();
            ushort numTextureRef = loader.ReadUInt16();
            ushort numMatAnim    = loader.ReadUInt16();
            int    numPatAnim    = loader.ReadInt32();
            int    numCurve      = loader.ReadInt32();

            BakedSize          = loader.ReadUInt32();
            BindModel          = loader.Load <Model>();
            BindIndices        = loader.LoadCustom(() => loader.ReadUInt16s(numMatAnim));
            TexPatternMatAnims = loader.LoadList <TexPatternMatAnim>(numMatAnim);
            TextureRefs        = loader.LoadDict <TextureRef>();
            UserData           = loader.LoadDict <UserData>();
        }
Ejemplo n.º 14
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            _flags         = loader.ReadUInt32();
            Name           = loader.LoadString();
            BeginRotate    = loader.ReadByte();
            BeginTranslate = loader.ReadByte();
            byte numCurve = loader.ReadByte();

            BeginBaseTranslate = loader.ReadByte();
            BeginCurve         = loader.ReadInt32();
            Curves             = loader.LoadList <AnimCurve>(numCurve);
            BaseData           = loader.LoadCustom(() => new BoneAnimData(loader, FlagsBase));
        }
Ejemplo n.º 15
0
        // TODO: Methods to retrieve the strongly-typed shader param value.

        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            Type = loader.ReadEnum <ShaderParamType>(true);
            if (loader.ResFile.Version >= 0x03030000)
            {
                byte sizData = loader.ReadByte();
                DataOffset = loader.ReadUInt16();
                int  offset          = loader.ReadInt32(); // Uniform variable offset.
                uint callbackPointer = loader.ReadUInt32();
                DependedIndex = loader.ReadUInt16();
                DependIndex   = loader.ReadUInt16();
                Name          = loader.LoadString();
            }
            else
            {
                // GUESS
                loader.Seek(1);
                DataOffset = loader.ReadUInt16();
                int offset = loader.ReadInt32(); // Uniform variable offset.
                Name = loader.LoadString();
            }
        }
Ejemplo n.º 16
0
        void IResData.Load(ResFileLoader loader)
        {
            if (loader.IsSwitch)
            {
                Name = loader.LoadString();
                uint CurveOffset    = loader.ReadOffset();
                uint BaseDataOffset = loader.ReadOffset();
                if (loader.ResFile.VersionMajor2 == 9)
                {
                    long unk1 = loader.ReadInt64();
                    long unk2 = loader.ReadInt64();
                }
                _flags         = loader.ReadUInt32();
                BeginRotate    = loader.ReadByte();
                BeginTranslate = loader.ReadByte();
                byte numCurve = loader.ReadByte();
                BeginBaseTranslate = loader.ReadByte();
                BeginCurve         = loader.ReadInt32();
                int padding = loader.ReadInt32();

                BaseData = loader.LoadCustom(() => new BoneAnimData(loader, FlagsBase), BaseDataOffset);
                Curves   = loader.LoadList <AnimCurve>(numCurve, CurveOffset);
            }
            else
            {
                _flags         = loader.ReadUInt32();
                Name           = loader.LoadString();
                BeginRotate    = loader.ReadByte();
                BeginTranslate = loader.ReadByte();
                byte numCurve = loader.ReadByte();
                BeginBaseTranslate = loader.ReadByte();
                BeginCurve         = loader.ReadByte();
                loader.Seek(3);
                Curves   = loader.LoadList <AnimCurve>(numCurve);
                BaseData = loader.LoadCustom(() => new BoneAnimData(loader, FlagsBase));
            }
        }
Ejemplo n.º 17
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            ushort numCurve;
            ushort numKeyShapeAnim;

            if (loader.ResFile.Version >= 0x03040000)
            {
                numCurve        = loader.ReadUInt16();
                numKeyShapeAnim = loader.ReadUInt16();
            }
            else
            {
                numCurve        = loader.ReadByte();
                numKeyShapeAnim = loader.ReadByte();
                unk             = loader.ReadUInt16();
            }

            BeginCurve        = loader.ReadInt32();
            BeginKeyShapeAnim = loader.ReadInt32();
            Name = loader.LoadString();
            KeyShapeAnimInfos = loader.LoadList <KeyShapeAnimInfo>(numKeyShapeAnim);
            Curves            = loader.LoadList <AnimCurve>(numCurve);
            BaseDataList      = loader.LoadCustom(() => loader.ReadSingles(numKeyShapeAnim - 1)); // Without base shape.
        }
Ejemplo n.º 18
0
        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Flags = loader.ReadEnum <CameraAnimFlags>(true);
            loader.Seek(2);
            FrameCount = loader.ReadInt32();
            byte numCurve = loader.ReadByte();

            loader.Seek(1);
            ushort numUserData = loader.ReadUInt16();

            BakedSize = loader.ReadUInt32();
            Name      = loader.LoadString();
            Curves    = loader.LoadList <AnimCurve>(numCurve);
            BaseData  = loader.LoadCustom(() => new CameraAnimData(loader));
            UserData  = loader.LoadDict <UserData>();
        }
Ejemplo n.º 19
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            if (loader.IsSwitch)
            {
                Switch.ShapeAnimParser.Read((Switch.Core.ResFileSwitchLoader)loader, this);
            }
            else
            {
                Name  = loader.LoadString();
                Path  = loader.LoadString();
                Flags = loader.ReadEnum <ShapeAnimFlags>(true);

                ushort numUserData;
                ushort numVertexShapeAnim;
                ushort numKeyShapeAnim;
                ushort numCurve;
                if (loader.ResFile.Version >= 0x03040000)
                {
                    numUserData        = loader.ReadUInt16();
                    FrameCount         = loader.ReadInt32();
                    numVertexShapeAnim = loader.ReadUInt16();
                    numKeyShapeAnim    = loader.ReadUInt16();
                    numCurve           = loader.ReadUInt16();
                    loader.Seek(2);
                    BakedSize = loader.ReadUInt32();
                }
                else
                {
                    FrameCount         = loader.ReadUInt16();
                    numVertexShapeAnim = loader.ReadUInt16();
                    numKeyShapeAnim    = loader.ReadUInt16();
                    numUserData        = loader.ReadUInt16();
                    numCurve           = loader.ReadUInt16();
                    BakedSize          = loader.ReadUInt32();
                }

                BindModel        = loader.Load <Model>();
                BindIndices      = loader.LoadCustom(() => loader.ReadUInt16s(numVertexShapeAnim));
                VertexShapeAnims = loader.LoadList <VertexShapeAnim>(numVertexShapeAnim);
                UserData         = loader.LoadDict <UserData>();
            }
        }
Ejemplo n.º 20
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Name  = loader.LoadString();
            Path  = loader.LoadString();
            Flags = loader.ReadEnum <ShapeAnimFlags>(true);
            ushort numUserData = loader.ReadUInt16();

            FrameCount = loader.ReadInt32();
            ushort numVertexShapeAnim = loader.ReadUInt16();
            ushort numKeyShapeAnim    = loader.ReadUInt16();
            ushort numCurve           = loader.ReadUInt16();

            loader.Seek(2);
            BakedSize        = loader.ReadUInt32();
            BindModel        = loader.Load <Model>();
            BindIndices      = loader.LoadCustom(() => loader.ReadUInt16s(numVertexShapeAnim));
            VertexShapeAnims = loader.LoadList <VertexShapeAnim>(numVertexShapeAnim);
            UserData         = loader.LoadDict <UserData>();
        }
Ejemplo n.º 21
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            if (loader.IsSwitch)
            {
                Switch.CameraAnimParser.Read((Switch.Core.ResFileSwitchLoader)loader, this);
            }
            else
            {
                Flags = loader.ReadEnum <CameraAnimFlags>(false);
                loader.Seek(2);
                FrameCount = loader.ReadInt32();
                byte numCurve = loader.ReadByte();
                loader.Seek(1);
                ushort numUserData = loader.ReadUInt16();
                BakedSize = loader.ReadUInt32();
                Name      = loader.LoadString();
                Curves    = loader.LoadList <AnimCurve>(numCurve);
                BaseData  = loader.LoadCustom(() => new CameraAnimData(loader));
                UserData  = loader.LoadDict <UserData>();
            }
        }
Ejemplo n.º 22
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        internal void Load(ResFileLoader loader, string signature)
        {
            ParamAnimInfos   = new List <ParamAnimInfo>();
            PatternAnimInfos = new List <PatternAnimInfo>();
            Constants        = new List <AnimConstant>();
            Curves           = new List <AnimCurve>();

            if (signature == "FSHU")
            {
                ushort numAnimParam = loader.ReadUInt16();
                ushort numCurve     = loader.ReadUInt16();
                ushort numConstant  = loader.ReadUInt16();
                loader.Seek(2);
                ShaderParamCurveIndex = loader.ReadInt32();
                InfoIndex             = loader.ReadInt32();
                Name           = loader.LoadString();
                ParamAnimInfos = loader.LoadList <ParamAnimInfo>(numAnimParam);
                Curves         = loader.LoadList <AnimCurve>(numCurve);
                Constants      = loader.LoadCustom(() => loader.ReadAnimConstants(numConstant));
            }
            else if (signature == "FTXP")
            {
                ushort numPatAnim = loader.ReadUInt16();
                ushort numCurve   = loader.ReadUInt16();
                TexturePatternCurveIndex = loader.ReadInt32();
                InfoIndex        = loader.ReadInt32();
                Name             = loader.LoadString();
                PatternAnimInfos = loader.LoadList <PatternAnimInfo>(numPatAnim);
                Curves           = loader.LoadList <AnimCurve>(numCurve);
                BaseDataList     = loader.LoadCustom(() => loader.ReadUInt16s(numPatAnim));
            }
            else if (signature == "FMAA")
            {
                Name = loader.LoadString();
                uint ShaderParamAnimOffset    = loader.ReadOffset();
                uint TexturePatternAnimOffset = loader.ReadOffset();
                uint CurveOffset             = loader.ReadOffset();
                uint ConstantAnimArrayOffset = loader.ReadOffset();
                ShaderParamCurveIndex    = loader.ReadUInt16();
                TexturePatternCurveIndex = loader.ReadUInt16();
                VisualConstantIndex      = loader.ReadUInt16();
                VisalCurveIndex          = loader.ReadUInt16();
                BeginVisalConstantIndex  = loader.ReadUInt16();
                ushort ShaderParamAnimCount    = loader.ReadUInt16();
                ushort TexutrePatternAnimCount = loader.ReadUInt16();
                ushort ConstantAnimCount       = loader.ReadUInt16();
                ushort CurveCount = loader.ReadUInt16();
                loader.Seek(6);

                Curves           = loader.LoadList <AnimCurve>(CurveCount, CurveOffset);
                ParamAnimInfos   = loader.LoadList <ParamAnimInfo>(ShaderParamAnimCount, ShaderParamAnimOffset);
                PatternAnimInfos = loader.LoadList <PatternAnimInfo>(TexutrePatternAnimCount, TexturePatternAnimOffset);
                Constants        = loader.LoadCustom(() => loader.ReadAnimConstants(ConstantAnimCount), ConstantAnimArrayOffset);

                //Set base data list for texture patterns
                //Get the first value from either constants or curves
                BaseDataList = new ushort[PatternAnimInfos.Count];
                for (int i = 0; i < PatternAnimInfos.Count; i++)
                {
                    if (PatternAnimInfos[i].BeginConstant != ushort.MaxValue)
                    {
                        BaseDataList[i] = (ushort)((int)Constants[PatternAnimInfos[i].BeginConstant].Value);
                    }
                    else if (PatternAnimInfos[i].CurveIndex != ushort.MaxValue)
                    {
                        BaseDataList[i] = (ushort)Curves[PatternAnimInfos[i].CurveIndex].Keys[0, 0];
                    }
                }
            }
        }
Ejemplo n.º 23
0
        void IResData.Load(ResFileLoader loader)
        {
            long   FrameArrayOffset = 0;
            long   KeyArrayOffset   = 0;
            ushort numKey           = 0;

            if (loader.IsSwitch)
            {
                FrameArrayOffset = loader.ReadOffset();
                KeyArrayOffset   = loader.ReadOffset();
                _flags           = loader.ReadUInt16();
                numKey           = loader.ReadUInt16();
                AnimDataOffset   = loader.ReadUInt32();
                StartFrame       = loader.ReadSingle();
                EndFrame         = loader.ReadSingle();
                Scale            = loader.ReadSingle();
                Offset           = loader.ReadSingle();
                Delta            = loader.ReadSingle();
                int padding = loader.ReadInt32();
            }
            else
            {
                _flags         = loader.ReadUInt16();
                numKey         = loader.ReadUInt16();
                AnimDataOffset = loader.ReadUInt32();
                StartFrame     = loader.ReadSingle();
                EndFrame       = loader.ReadSingle();
                Scale          = loader.ReadSingle();
                Offset         = loader.ReadSingle();
                if (loader.ResFile.Version >= 0x03040000)
                {
                    Delta = loader.ReadSingle();
                }
                FrameArrayOffset = loader.ReadOffset();
                KeyArrayOffset   = loader.ReadOffset();
            }

            Frames = loader.LoadCustom(() =>
            {
                switch (FrameType)
                {
                case AnimCurveFrameType.Single:
                    return(loader.ReadSingles(numKey));

                case AnimCurveFrameType.Decimal10x5:
                    float[] dec10x5Frames = new float[numKey];
                    for (int i = 0; i < numKey; i++)
                    {
                        dec10x5Frames[i] = (float)loader.ReadDecimal10x5();
                    }
                    return(dec10x5Frames);

                case AnimCurveFrameType.Byte:
                    float[] byteFrames = new float[numKey];
                    for (int i = 0; i < numKey; i++)
                    {
                        byteFrames[i] = loader.ReadByte();
                    }
                    return(byteFrames);

                default:
                    throw new ResException($"Invalid {nameof(FrameType)}.");
                }
            }, (uint)FrameArrayOffset);
            Keys = loader.LoadCustom(() =>
            {
                int elementsPerKey = ElementsPerKey;
                float[,] keys      = new float[numKey, elementsPerKey];
                switch (KeyType)
                {
                case AnimCurveKeyType.Single:
                    for (int i = 0; i < numKey; i++)
                    {
                        for (int j = 0; j < elementsPerKey; j++)
                        {
                            if (CurveType == AnimCurveType.StepInt || CurveType == AnimCurveType.StepBool)
                            {
                                keys[i, j] = loader.ReadUInt32();
                            }
                            else
                            {
                                keys[i, j] = loader.ReadSingle();
                            }
                        }
                    }
                    break;

                case AnimCurveKeyType.Int16:
                    for (int i = 0; i < numKey; i++)
                    {
                        for (int j = 0; j < elementsPerKey; j++)
                        {
                            keys[i, j] = loader.ReadInt16();
                        }
                    }
                    break;

                case AnimCurveKeyType.SByte:
                    for (int i = 0; i < numKey; i++)
                    {
                        for (int j = 0; j < elementsPerKey; j++)
                        {
                            keys[i, j] = loader.ReadSByte();
                        }
                    }
                    break;

                default:
                    throw new ResException($"Invalid {nameof(KeyType)}.");
                }
                return(keys);
            }, (uint)KeyArrayOffset);

            //Bools use bits to store values.
            if (CurveType == AnimCurveType.StepBool)
            {
                int keyIndex = 0;

                KeyStepBoolData = new bool[numKey];
                for (int i = 0; i < Keys.Length; i++)
                {
                    if (numKey <= keyIndex)
                    {
                        break;
                    }

                    int value = (int)Keys[i, 0];

                    //Bit shift each key value
                    for (int j = 0; j < 32; j++)
                    {
                        if (numKey <= keyIndex)
                        {
                            break;
                        }

                        bool set = (value & 0x1) != 0;
                        value >>= 1;

                        KeyStepBoolData[keyIndex] = set;
                        keyIndex++;
                    }
                }
            }
        }
Ejemplo n.º 24
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            signature = loader.ReadString(4, Encoding.ASCII);
            uint   materialAnimOffset = 0;
            ushort materialCount      = 0;

            if (signature == "FMAA")
            {
                if (loader.ResFile.VersionMajor2 == 9)
                {
                    Flags = loader.ReadEnum <MaterialAnimFlags>(true);
                    loader.ReadUInt16();
                }
                else
                {
                    ((Switch.Core.ResFileSwitchLoader)loader).LoadHeaderBlock();
                }

                Name      = loader.LoadString();
                Path      = loader.LoadString();
                BindModel = loader.Load <Model>(true);
                uint BindIndicesOffset = loader.ReadOffset();
                materialAnimOffset = loader.ReadOffset();
                uint unk = loader.ReadOffset(); //Empty section. Maybe set at runtime
                uint TextureNameArrayOffset = loader.ReadOffset();
                UserData = loader.LoadDictValues <UserData>();
                uint TextureBindArrayOffset = loader.ReadOffset();

                if (loader.ResFile.VersionMajor2 != 9)
                {
                    Flags = loader.ReadEnum <MaterialAnimFlags>(true);
                }

                ushort numUserData = 0;
                ushort CurveCount  = 0;

                if (loader.ResFile.VersionMajor2 == 9)
                {
                    FrameCount    = loader.ReadInt32();
                    BakedSize     = loader.ReadUInt32();
                    numUserData   = loader.ReadUInt16();
                    materialCount = loader.ReadUInt16();
                    CurveCount    = loader.ReadUInt16();
                }
                else
                {
                    numUserData   = loader.ReadUInt16();
                    materialCount = loader.ReadUInt16();
                    CurveCount    = loader.ReadUInt16();
                    FrameCount    = loader.ReadInt32();
                    BakedSize     = loader.ReadUInt32();
                }

                ushort ShaderParamAnimCount    = loader.ReadUInt16();
                ushort TexturePatternAnimCount = loader.ReadUInt16();
                ushort VisabiltyAnimCount      = loader.ReadUInt16();
                ushort TextureCount            = loader.ReadUInt16();

                if (loader.ResFile.VersionMajor2 == 9)
                {
                    loader.ReadUInt16(); //padding
                }
                BindIndices = loader.LoadCustom(() => loader.ReadUInt16s(materialCount), BindIndicesOffset);
                var textureList = loader.LoadCustom(() => loader.LoadStrings(TextureCount), TextureNameArrayOffset);
                TextureBindArray = loader.LoadCustom(() => loader.ReadInt64s(TextureCount), TextureBindArrayOffset);

                if (textureList == null)
                {
                    textureList = new List <string>();
                }

                foreach (var tex in textureList)
                {
                    TextureNames.Add(tex, new TextureRef()
                    {
                        Name = tex
                    });
                }
            }
            else if (signature == "FSHU")
            {
                if (loader.ResFile.Version >= 0x02040000)
                {
                    Name  = loader.LoadString();
                    Path  = loader.LoadString();
                    Flags = (MaterialAnimFlags)loader.ReadUInt32();

                    if (loader.ResFile.Version >= 0x03040000)
                    {
                        FrameCount    = loader.ReadInt32();
                        materialCount = loader.ReadUInt16();
                        ushort numUserData  = loader.ReadUInt16();
                        int    numParamAnim = loader.ReadInt32();
                        int    numCurve     = loader.ReadInt32();
                        BakedSize = loader.ReadUInt32();
                    }
                    else
                    {
                        FrameCount    = loader.ReadUInt16();
                        materialCount = loader.ReadUInt16();
                        UnknownValue  = loader.ReadUInt32();
                        int numCurve = loader.ReadInt32();
                        BakedSize = loader.ReadUInt32();
                        int padding2 = loader.ReadInt32();
                    }
                    BindModel          = loader.Load <Model>();
                    BindIndices        = loader.LoadCustom(() => loader.ReadUInt16s(materialCount));
                    materialAnimOffset = loader.ReadOffset();
                    UserData           = loader.LoadDict <UserData>();
                }
                else
                {
                    Flags         = (MaterialAnimFlags)loader.ReadUInt32();
                    FrameCount    = loader.ReadInt16();
                    materialCount = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    ushort unk         = loader.ReadUInt16();
                    BakedSize          = loader.ReadUInt32();
                    Name               = loader.LoadString();
                    Path               = loader.LoadString();
                    BindModel          = loader.Load <Model>();
                    BindIndices        = loader.LoadCustom(() => loader.ReadUInt16s(materialCount));
                    materialAnimOffset = loader.ReadOffset();
                }
            }
            else if (signature == "FTXP")
            {
                Name  = loader.LoadString();
                Path  = loader.LoadString();
                Flags = loader.ReadEnum <MaterialAnimFlags>(true);
                ushort numTextureRef = 0;
                if (loader.ResFile.Version >= 0x03040000)
                {
                    ushort numUserData = loader.ReadUInt16();
                    FrameCount    = loader.ReadInt32();
                    numTextureRef = loader.ReadUInt16();
                    materialCount = loader.ReadUInt16();
                    int numPatAnim = loader.ReadInt32();
                    int numCurve   = loader.ReadInt32();
                    BakedSize = loader.ReadUInt32();
                }
                else
                {
                    FrameCount    = loader.ReadUInt16();
                    numTextureRef = loader.ReadUInt16();
                    materialCount = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    int    numPatAnim  = loader.ReadInt16();
                    int    numCurve    = loader.ReadInt32();
                    BakedSize = loader.ReadUInt32();
                    loader.Seek(4); //padding
                }


                BindModel          = loader.Load <Model>();
                BindIndices        = loader.LoadCustom(() => loader.ReadUInt16s(materialCount));
                materialAnimOffset = loader.ReadOffset();
                if (loader.ResFile.Version >= 0x03040000)
                {
                    TextureNames = loader.LoadDict <TextureRef>();
                }
                else
                {
                    int TextureCount = 0;
                    foreach (var patternAnim in MaterialAnimDataList)
                    {
                        foreach (var curve in patternAnim.Curves)
                        {
                            List <uint> frames = new List <uint>();
                            foreach (float key in curve.Keys)
                            {
                                frames.Add((uint)key);
                            }
                            TextureCount = (short)frames.Max();
                        }
                    }
                    var TextureRefNames = loader.LoadList <TextureRef>(numTextureRef);
                    foreach (var texRef in TextureRefNames)
                    {
                        TextureNames.Add(texRef.Name, texRef);
                    }
                }
                UserData = loader.LoadDict <UserData>();
            }

            //Load materials and parse based on the signature of the section
            MaterialAnimDataList = loader.LoadCustom(() =>
            {
                List <MaterialAnimData> materialAnims = new List <MaterialAnimData>();
                for (int i = 0; i < materialCount; i++)
                {
                    materialAnims.Add(new MaterialAnimData(loader, signature));
                }
                return(materialAnims);
            }, materialAnimOffset);
        }
Ejemplo n.º 25
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            Name  = loader.LoadString();
            Path  = loader.LoadString();
            Flags = loader.ReadEnum <TexPatternAnimFlags>(true);
            ushort numMatAnim    = 0;
            ushort numTextureRef = 0;

            if (loader.ResFile.Version >= 0x03040000)
            {
                ushort numUserData = loader.ReadUInt16();
                FrameCount    = loader.ReadInt32();
                numTextureRef = loader.ReadUInt16();
                numMatAnim    = loader.ReadUInt16();
                int numPatAnim = loader.ReadInt32();
                int numCurve   = loader.ReadInt32();
                BakedSize = loader.ReadUInt32();
            }
            else
            {
                FrameCount    = loader.ReadUInt16();
                numTextureRef = loader.ReadUInt16();
                numMatAnim    = loader.ReadUInt16();
                ushort numUserData = loader.ReadUInt16();
                //     loader.Seek(2); //padding
                int numPatAnim = loader.ReadInt16();
                int numCurve   = loader.ReadInt32();
                BakedSize = loader.ReadUInt32();
                loader.Seek(4); //padding
            }


            BindModel          = loader.Load <Model>();
            BindIndices        = loader.LoadCustom(() => loader.ReadUInt16s(numMatAnim));
            TexPatternMatAnims = loader.LoadList <TexPatternMatAnim>(numMatAnim);
            if (loader.ResFile.Version >= 0x03040000)
            {
                TextureRefs = loader.LoadDict <TextureRef>();
            }
            else
            {
                int TextureCount = 0;
                foreach (var patternAnim in TexPatternMatAnims)
                {
                    foreach (var curve in patternAnim.Curves)
                    {
                        List <uint> frames = new List <uint>();
                        foreach (float key in curve.Keys)
                        {
                            //      Console.WriteLine((uint)key);
                            frames.Add((uint)key);
                        }
                        TextureCount = (short)frames.Max();

                        /*
                         *    for (int i = 0; i < (ushort)curve.Frames.Length; i++)
                         *    {
                         *        if (curve.Scale != 0)
                         *        {
                         *            int test = (int)curve.Keys[i, 0];
                         *            float key = curve.Offset + test * curve.Scale;
                         *            frames.Add((int)key);
                         *        }
                         *        else
                         *        {
                         *            float test = curve.Keys[i, 0];
                         *            int key = curve.Offset + (int)test;
                         *            frames.Add((int)key);
                         *
                         *            int testCeiling = (int)Math.Ceiling(test);
                         *            int testFloor = (int)Math.Floor(test);
                         *            int testRound = (int)Math.Round(test);
                         *
                         *            Console.WriteLine("convert int = {0}", (Decimal10x5)test);
                         *        }
                         *    }*/
                    }
                }
                Console.WriteLine(Name + " Tex Total " + (TextureCount + 1));

                TextureRefNames = loader.LoadList <TextureRef>(numTextureRef);
            }
            UserData = loader.LoadDict <UserData>();
        }
Ejemplo n.º 26
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            _flags = loader.ReadUInt16();
            ushort numKey = loader.ReadUInt16();

            AnimDataOffset = loader.ReadUInt32();
            StartFrame     = loader.ReadSingle();
            EndFrame       = loader.ReadSingle();
            Scale          = loader.ReadSingle();
            Offset         = loader.ReadSingle();
            if (loader.ResFile.Version >= 0x03040000)
            {
                Delta = loader.ReadSingle();
            }

            Frames = loader.LoadCustom(() =>
            {
                switch (FrameType)
                {
                case AnimCurveFrameType.Single:
                    if (CurveType == AnimCurveType.StepInt)
                    {
                        float[] dec10x5Frame = new float[numKey];
                        for (int i = 0; i < numKey; i++)
                        {
                            dec10x5Frame[i] = loader.ReadUInt32();
                        }
                        return(dec10x5Frame);
                    }
                    else
                    {
                        return(loader.ReadSingles(numKey));
                    }

                case AnimCurveFrameType.Decimal10x5:
                    float[] dec10x5Frames = new float[numKey];
                    for (int i = 0; i < numKey; i++)
                    {
                        dec10x5Frames[i] = (float)loader.ReadDecimal10x5();
                    }
                    return(dec10x5Frames);

                case AnimCurveFrameType.Byte:
                    float[] byteFrames = new float[numKey];
                    for (int i = 0; i < numKey; i++)
                    {
                        byteFrames[i] = loader.ReadByte();
                    }
                    return(byteFrames);

                default:
                    throw new ResException($"Invalid {nameof(FrameType)}.");
                }
            });

            //Bools use bits to store values.
            if (CurveType == AnimCurveType.StepBool)
            {
                int KeyBool = 0;

                if (KeyType == AnimCurveKeyType.Single) //Read them as a int instead of a float
                {
                    KeyBool = loader.LoadCustom(() => loader.ReadInt32());
                }
                else if (KeyType == AnimCurveKeyType.Int16)
                {
                    KeyBool = loader.LoadCustom(() => loader.ReadInt16());
                }
                else if (KeyType == AnimCurveKeyType.SByte)
                {
                    KeyBool = loader.LoadCustom(() => loader.ReadSByte());
                }

                KeyStepBoolData = new bool[numKey];

                for (int i = 0; i < numKey; i++)
                {
                    bool set = (KeyBool & 0x1) != 0;
                    KeyBool >>= 1;

                    KeyStepBoolData[i] = set;
                }
            }
            else
            {
                Keys = loader.LoadCustom(() =>
                {
                    int elementsPerKey = ElementsPerKey;
                    float[,] keys      = new float[numKey, elementsPerKey];
                    switch (KeyType)
                    {
                    case AnimCurveKeyType.Single:
                        for (int i = 0; i < numKey; i++)
                        {
                            for (int j = 0; j < elementsPerKey; j++)
                            {
                                if (CurveType == AnimCurveType.StepInt)
                                {
                                    keys[i, j] = loader.ReadUInt32();
                                }
                                else
                                {
                                    keys[i, j] = loader.ReadSingle();
                                }
                            }
                        }
                        break;

                    case AnimCurveKeyType.Int16:
                        for (int i = 0; i < numKey; i++)
                        {
                            for (int j = 0; j < elementsPerKey; j++)
                            {
                                keys[i, j] = loader.ReadInt16();
                            }
                        }
                        break;

                    case AnimCurveKeyType.SByte:
                        for (int i = 0; i < numKey; i++)
                        {
                            for (int j = 0; j < elementsPerKey; j++)
                            {
                                keys[i, j] = loader.ReadSByte();
                            }
                        }
                        break;

                    default:
                        throw new ResException($"Invalid {nameof(KeyType)}.");
                    }
                    return(keys);
                });
            }
        }
Ejemplo n.º 27
0
        // ---- METHODS ------------------------------------------------------------------------------------------------

        void IResData.Load(ResFileLoader loader)
        {
            loader.CheckSignature(_signature);
            if (loader.IsSwitch)
            {
                if (loader.ResFile.VersionMajor2 == 9)
                {
                    _flags = loader.ReadUInt32();
                }
                else
                {
                    ((Switch.Core.ResFileSwitchLoader)loader).LoadHeaderBlock();
                }

                Name         = loader.LoadString();
                Path         = loader.LoadString();
                BindSkeleton = loader.Load <Skeleton>();
                uint BindIndexArray      = loader.ReadOffset();
                uint BoneAnimArrayOffset = loader.ReadOffset();
                UserData = loader.LoadDictValues <UserData>();
                if (loader.ResFile.VersionMajor2 != 9)
                {
                    _flags = loader.ReadUInt32();
                }

                FrameCount = loader.ReadInt32();
                int numCurve = loader.ReadInt32();
                BakedSize = loader.ReadUInt32();
                ushort numBoneAnim = loader.ReadUInt16();
                ushort numUserData = loader.ReadUInt16();

                if (loader.ResFile.VersionMajor2 != 9)
                {
                    loader.ReadUInt32(); //Padding
                }
                BoneAnims   = loader.LoadList <BoneAnim>(numBoneAnim, BoneAnimArrayOffset).ToList();
                BindIndices = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim), BindIndexArray);
            }
            else
            {
                ushort numBoneAnim = 0;
                if (loader.ResFile.Version >= 0x02040000)
                {
                    Name   = loader.LoadString();
                    Path   = loader.LoadString();
                    _flags = loader.ReadUInt32();

                    if (loader.ResFile.Version >= 0x03040000)
                    {
                        FrameCount  = loader.ReadInt32();
                        numBoneAnim = loader.ReadUInt16();
                        ushort numUserData = loader.ReadUInt16();
                        int    numCurve    = loader.ReadInt32();
                        BakedSize = loader.ReadUInt32();
                    }
                    else
                    {
                        FrameCount  = loader.ReadUInt16();
                        numBoneAnim = loader.ReadUInt16();
                        ushort numUserData = loader.ReadUInt16();
                        ushort numCurve    = loader.ReadUInt16();
                        BakedSize = loader.ReadUInt32();
                        loader.Seek(4); //padding
                    }

                    BoneAnims    = loader.LoadList <BoneAnim>(numBoneAnim).ToList();
                    BindSkeleton = loader.Load <Skeleton>();
                    BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim));
                    UserData     = loader.LoadDict <UserData>();
                }
                else
                {
                    _flags      = loader.ReadUInt32();
                    FrameCount  = loader.ReadUInt16();
                    numBoneAnim = loader.ReadUInt16();
                    ushort numUserData = loader.ReadUInt16();
                    ushort numCurve    = loader.ReadUInt16();
                    Name         = loader.LoadString();
                    Path         = loader.LoadString();
                    BoneAnims    = loader.LoadList <BoneAnim>(numBoneAnim).ToList();
                    BindSkeleton = loader.Load <Skeleton>();
                    BindIndices  = loader.LoadCustom(() => loader.ReadUInt16s(numBoneAnim));
                }
            }
        }