Пример #1
0
        public override void Replace(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfmaa")
            {
                MaterialAnim.Import(FileName);
                MaterialAnim.Name = Text;
                LoadAnim(MaterialAnim);
            }
            else if (ext == ".yaml")
            {
                MaterialAnim      = YamlFmaa.FromYaml(FileName);
                MaterialAnim.Name = Text;
                LoadAnim(MaterialAnim);
            }
            else if (ext == ".gif" || ext == ".png" || ext == ".apng")
            {
                BNTX bntx = PluginRuntime.bntxContainers[0];
                GifToTexturePatternAnimation anim = new GifToTexturePatternAnimation(FileName, bntx, this);
                MaterialAnim.Name = Text;
                LoadAnim(MaterialAnim);
            }

            UpdateEditor();
        }
Пример #2
0
        public override void Export(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfshu")
            {
                ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.ShaderParameter);
            }
            else if (ext == ".bfcsh")
            {
                ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.Color);
            }
            else if (ext == ".bftsh")
            {
                ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.TextureSRT);
            }
            else if (ext == ".bfmaa")
            {
                var fmaa = BfresPlatformConverter.FSHUConvertWiiUToSwitch(ShaderParamAnim);
                fmaa.Export(FileName, new Syroot.NintenTools.NSW.Bfres.ResFile());
            }
            else if (ext == ".yaml")
            {
                var yaml = YamlFmaa.ToYaml(FileName, BfresPlatformConverter.FSHUConvertWiiUToSwitch(ShaderParamAnim), this.AnimType);
                System.IO.File.WriteAllText(FileName, yaml);
            }
            else if (ext == ".clr0")
            {
            }
        }
Пример #3
0
        public override void Export(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfmaa")
            {
                MaterialAnim.Export(FileName, GetResFile());
            }
            else if (ext == ".yaml")
            {
                System.IO.File.WriteAllText(FileName, YamlFmaa.ToYaml(FileName, MaterialAnim, AnimType));
            }
        }
Пример #4
0
        public void Replace(string FileName, ResFile resFile)
        {
            ShaderParamAnim = new ShaderParamAnim();

            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfshu")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.ShaderParameter);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bfcsh")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.Color);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bftsh")
            {
                ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.TextureSRT);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".bfmaa")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();;
                fmaa.Import(FileName);
                ShaderParamAnim      = BfresPlatformConverter.FSHUConvertSwitchToWiiU(fmaa);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".yaml")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                fmaa                 = YamlFmaa.FromYaml(FileName);
                ShaderParamAnim      = BfresPlatformConverter.FSHUConvertSwitchToWiiU(fmaa);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }
            else if (ext == ".clr0")
            {
                ShaderParamAnim      = BrawlboxHelper.FSHUConverter.Clr02Fshu(FileName);
                ShaderParamAnim.Name = Text;
                LoadAnim(ShaderParamAnim, AnimType);
            }

            UpdateEditor();
        }
Пример #5
0
        public override void Export(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bftxp")
            {
                TexPatternAnim.Export(FileName, GetResFile());
            }
            else if (ext == ".bfmaa")
            {
                var fmaa = BfresPlatformConverter.FTXPConvertWiiUToSwitch(TexPatternAnim);
                fmaa.Export(FileName, new Syroot.NintenTools.NSW.Bfres.ResFile());
            }
            else if (ext == ".yaml")
            {
                var yaml = YamlFmaa.ToYaml(FileName, BfresPlatformConverter.FTXPConvertWiiUToSwitch(TexPatternAnim), AnimationType.TexturePattern);
                System.IO.File.WriteAllText(FileName, yaml);
            }
        }
Пример #6
0
        public void Replace(string FileName, ResFile resFile)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bftxp")
            {
                bool IsSwitch = BfresUtilies.IsSubSectionSwitch(FileName);
                if (IsSwitch)
                {
                    var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                    fmaa.Import(FileName);
                    TexPatternAnim = BfresPlatformConverter.FTXPConvertSwitchToWiiU(fmaa);
                }
                else
                {
                    TexPatternAnim.Import(FileName, resFile);
                }

                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
            else if (ext == ".yaml")
            {
                var fmaa = new Syroot.NintenTools.NSW.Bfres.MaterialAnim();
                fmaa                = YamlFmaa.FromYaml(FileName);
                TexPatternAnim      = BfresPlatformConverter.FTXPConvertSwitchToWiiU(fmaa);
                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
            else if (ext == ".gif")
            {
                BFRESGroupNode ftexFolder         = PluginRuntime.ftexContainers[0];
                GifToTexturePatternAnimation anim = new GifToTexturePatternAnimation(FileName, ftexFolder, this);
                TexPatternAnim.Name = Text;
                LoadAnim(TexPatternAnim);
            }
        }