public static ResNX.MaterialAnim FSHUConvertWiiUToSwitch(ResU.ShaderParamAnim ShaderAnim)
        {
            ResNX.MaterialAnim matAnim = new ResNX.MaterialAnim();
            matAnim.Name        = ShaderAnim.Name;
            matAnim.Path        = ShaderAnim.Path;
            matAnim.FrameCount  = ShaderAnim.FrameCount;
            matAnim.BindIndices = ShaderAnim.BindIndices;
            matAnim.BakedSize   = ShaderAnim.BakedSize;
            matAnim.Loop        = ShaderAnim.Flags.HasFlag(ResU.TexPatternAnimFlags.Looping);

            int CurveIndex = 0;

            for (int m = 0; m < ShaderAnim.ShaderParamMatAnims.Count; m++)
            {
                ResNX.MaterialAnimData matAnimData = new ResNX.MaterialAnimData();
                matAnimData.Name = ShaderAnim.ShaderParamMatAnims[m].Name;

                foreach (var paramU in ShaderAnim.ShaderParamMatAnims[m].ParamAnimInfos)
                {
                    ResNX.ParamAnimInfo animInfo = new ResNX.ParamAnimInfo();
                    animInfo.Name            = paramU.Name;
                    animInfo.BeginCurve      = paramU.BeginCurve;
                    animInfo.BeginConstant   = paramU.BeginConstant;
                    animInfo.ConstantCount   = paramU.ConstantCount;
                    animInfo.FloatCurveCount = paramU.FloatCurveCount;
                    animInfo.IntCurveCount   = paramU.IntCurveCount;
                    animInfo.SubBindIndex    = paramU.SubBindIndex;

                    matAnimData.ParamAnimInfos.Add(animInfo);
                }

                if (ShaderAnim.ShaderParamMatAnims[m].Curves.Count == 0)
                {
                    foreach (var constant in ShaderAnim.ShaderParamMatAnims[m].Constants)
                    {
                        //Add base values as constants
                        matAnimData.Constants.Add(new ResNX.AnimConstant()
                        {
                            Value          = (float)constant.Value,
                            AnimDataOffset = constant.AnimDataOffset,
                        });
                    }
                }
                else
                {
                    matAnimData.ShaderParamCurveIndex   = CurveIndex++;
                    matAnimData.BeginVisalConstantIndex = 0;

                    matAnimData.Curves = ConvertAnimCurveWiiUToSwitch(ShaderAnim.ShaderParamMatAnims[m].Curves);
                }

                matAnim.MaterialAnimDataList.Add(matAnimData);
            }

            matAnim.UserData = ConvertUserDataWiiU2Switch(ShaderAnim.UserData);

            return(matAnim);
        }
        //Todo. Bake sizes are altered in switch somewhat, although mostly all animations should be fine

        public static ResNX.MaterialAnim FVISConvertWiiUToSwitch(ResU.VisibilityAnim VisualAnim)
        {
            ResNX.MaterialAnim matAnim = new ResNX.MaterialAnim();
            matAnim.Name        = VisualAnim.Name;
            matAnim.Path        = VisualAnim.Path;
            matAnim.FrameCount  = VisualAnim.FrameCount;
            matAnim.BindIndices = VisualAnim.BindIndices;
            matAnim.BakedSize   = VisualAnim.BakedSize;
            matAnim.Loop        = VisualAnim.Flags.HasFlag(ResU.TexPatternAnimFlags.Looping);

            int CurveIndex = 0;

            for (int m = 0; m < VisualAnim.Names.Count; m++)
            {
                ResNX.MaterialAnimData matAnimData = new ResNX.MaterialAnimData();
                matAnimData.Name = VisualAnim.Names[m];
            }

            matAnim.UserData = ConvertUserDataWiiU2Switch(VisualAnim.UserData);

            return(matAnim);
        }
        public static ResNX.MaterialAnim FTXPConvertWiiUToSwitch(ResU.TexPatternAnim texPatternAnim)
        {
            //Different versions use different lists
            if (texPatternAnim.TextureRefNames == null)
            {
                texPatternAnim.TextureRefNames = new List <ResU.TextureRef>();
            }
            if (texPatternAnim.TextureRefs == null)
            {
                texPatternAnim.TextureRefs = new ResU.ResDict <ResU.TextureRef>();
            }

            ResNX.MaterialAnim matAnim = new ResNX.MaterialAnim();
            matAnim.Name        = texPatternAnim.Name;
            matAnim.Path        = texPatternAnim.Path;
            matAnim.FrameCount  = texPatternAnim.FrameCount;
            matAnim.BindIndices = texPatternAnim.BindIndices;
            matAnim.BakedSize   = texPatternAnim.BakedSize;
            matAnim.Loop        = texPatternAnim.Flags.HasFlag(ResU.TexPatternAnimFlags.Looping);

            foreach (var texRef in texPatternAnim.TextureRefNames)
            {
                matAnim.TextureNames.Add(texRef.Name);
            }

            foreach (var texRef in texPatternAnim.TextureRefs)
            {
                matAnim.TextureNames.Add(texRef.Key);
            }

            int CurveIndex = 0;

            for (int m = 0; m < texPatternAnim.TexPatternMatAnims.Count; m++)
            {
                ResNX.MaterialAnimData matAnimData = new ResNX.MaterialAnimData();
                matAnimData.Name = texPatternAnim.TexPatternMatAnims[m].Name;

                foreach (var patternInfoU in texPatternAnim.TexPatternMatAnims[m].PatternAnimInfos)
                {
                    ResNX.TexturePatternAnimInfo animInfo = new ResNX.TexturePatternAnimInfo();
                    animInfo.Name          = patternInfoU.Name;
                    animInfo.CurveIndex    = (uint)patternInfoU.CurveIndex;
                    animInfo.BeginConstant = (ushort)patternInfoU.SubBindIndex;
                    matAnimData.TexturePatternAnimInfos.Add(animInfo);
                }

                if (texPatternAnim.TexPatternMatAnims[m].Curves.Count == 0)
                {
                    foreach (var baseData in texPatternAnim.TexPatternMatAnims[m].BaseDataList)
                    {
                        //Add base values as constants
                        matAnimData.Constants.Add(new ResNX.AnimConstant()
                        {
                            Value          = (int)baseData,
                            AnimDataOffset = 0,
                        });
                    }
                }
                else
                {
                    matAnimData.TexturePatternCurveIndex = CurveIndex++;
                    matAnimData.BeginVisalConstantIndex  = 0;

                    matAnimData.Curves = ConvertAnimCurveWiiUToSwitch(texPatternAnim.TexPatternMatAnims[m].Curves);
                }

                matAnim.MaterialAnimDataList.Add(matAnimData);
            }

            matAnim.TextureBindArray = new long[matAnim.TextureNames.Count];
            for (int i = 0; i < matAnim.TextureNames.Count; i++)
            {
                matAnim.TextureBindArray[i] = -1;
            }

            matAnim.UserData = ConvertUserDataWiiU2Switch(texPatternAnim.UserData);

            return(matAnim);
        }