Esempio n. 1
0
        public void ImportMatVisAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = FileFilters.FBNV;
            ofd.Multiselect = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FVIS>(VisibiltyAnimType.Material);
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(MaterialAnimation.AnimationType.Visibilty);
            }

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 2
0
        public void ImportColorAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (IsWiiU)
            {
                ofd.Filter = FileFilters.GetFilter(typeof(FSHU), MaterialAnimation.AnimationType.Color);
            }
            else
            {
                ofd.Filter = FileFilters.FMAA;
            }
            ofd.Multiselect = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FSHU>(MaterialAnimation.AnimationType.Color);
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(MaterialAnimation.AnimationType.Color);
            }

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 3
0
        public void ImportTexPatAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (IsWiiU)
            {
                ofd.Filter = FileFilters.FTXP;
            }
            else
            {
                ofd.Filter = FileFilters.FMAA;
            }
            ofd.Multiselect = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FTXP>();
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(MaterialAnimation.AnimationType.TexturePattern);
            }

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 4
0
 private void AddFolder(BFRESGroupNode group)
 {
     if (!Nodes.Contains(group))
     {
         Nodes.Add(group);
     }
 }
Esempio n. 5
0
        public string GetTypeExtension()
        {
            if (Parent == null)
            {
                return("");
            }

            BFRESGroupNode AnimFolder = (BFRESGroupNode)Parent;

            switch (AnimFolder.Type)
            {
            case BRESGroupType.TexPatAnim: return(TexturePatternAnimType);

            case BRESGroupType.ShaderParamAnim: return(ShaderParamAnimType);

            case BRESGroupType.TexSrtAnim: return(TextureSrtAnimType);

            case BRESGroupType.ColorAnim: return(ColorAnimType);

            case BRESGroupType.MatVisAnim: return(VisibiltyAnimType);

            default:
                return("");
            }
        }
Esempio n. 6
0
        public void ImportBoneVisAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = GetOrCreateFolder <FVIS>(VisibiltyAnimType.Bone);

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 7
0
        public void ImportShapeAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = GetOrCreateFolder <FSHA>();

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 8
0
        public void NewSceneAnim()
        {
            BFRESGroupNode group = GetOrCreateFolder <FSCN>();
            FSCN           fshu  = null;

            if (IsWiiU)
            {
                fshu = new FSCN(new ResU.SceneAnim());
            }
            else
            {
                fshu = new FSCN(new ResNX.SceneAnim());
            }

            group.AddNode(fshu, "NewSceneVisAnim");
            AddFolder(group);
        }
Esempio n. 9
0
        public void ImportSceneAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = FileFilters.FSCN;
            ofd.Multiselect = true;

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = GetOrCreateFolder <FSCN>();

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 10
0
        public void NewShapeAnim()
        {
            BFRESGroupNode group = GetOrCreateFolder <FSHA>();
            FSHA           anim  = null;

            if (IsWiiU)
            {
                anim = new FSHA(new ResU.ShapeAnim());
            }
            else
            {
                anim = new FSHA(new ResNX.ShapeAnim());
            }

            group.AddNode(anim, "NewShapeAnim");
            AddFolder(group);
        }
Esempio n. 11
0
        public void Replace(string FileName, ResFile resFile)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bftxp")
            {
                TexPatternAnim.Import(FileName, resFile);
                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);
            }
        }
Esempio n. 12
0
        public void NewBoneVisAnim()
        {
            BFRESGroupNode group = GetOrCreateFolder <FVIS>(VisibiltyAnimType.Bone);

            FVIS anim = null;

            if (IsWiiU)
            {
                anim = new FVIS(new ResU.VisibilityAnim()
                {
                    Type = ResU.VisibilityAnimType.Bone
                });
            }
            else
            {
                anim = new FVIS(new ResNX.VisibilityAnim());
            }

            group.AddNode(anim, "NewBoneVisAnim");
            AddFolder(group);
        }
Esempio n. 13
0
        public void NewTexPatAnim()
        {
            var type = MaterialAnimation.AnimationType.TexturePattern;

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FTXP>();
                FTXP anim = new FTXP(new ResU.TexPatternAnim());
                group.AddNode(anim, "NewTexturePatternAnim_ftp");
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(type);
                FMAA fmaa = new FMAA(new ResNX.MaterialAnim());
                group.AddNode(fmaa, "NewTexturePatternAnim_ftp");
            }

            AddFolder(group);
        }
Esempio n. 14
0
        public void NewTexSrtAnim()
        {
            var type = MaterialAnimation.AnimationType.TextureSrt;

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FSHU>(type);
                FSHU fshu = new FSHU(new ResU.ShaderParamAnim(), type);
                group.AddNode(fshu, "NewTextureTransformAnim_fts");
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(type);
                FMAA fmaa = new FMAA(new ResNX.MaterialAnim());
                group.AddNode(fmaa, "NewTextureTransformAnim_fts");
            }

            AddFolder(group);
        }
Esempio n. 15
0
        public void NewMatVisAnim()
        {
            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FVIS>(VisibiltyAnimType.Material);
                FVIS anim = new FVIS(new ResU.VisibilityAnim()
                {
                    Type = ResU.VisibilityAnimType.Material
                });
                group.AddNode(anim, "NewMatVisAnim_fvm");
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(MaterialAnimation.AnimationType.Visibilty);
                FMAA fmaa = new FMAA(new ResNX.MaterialAnim());
                group.AddNode(fmaa, "NewMatVisAnim_fvm");
            }

            AddFolder(group);
        }
Esempio n. 16
0
        public void ImportTexSrtAnim()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            BFRESGroupNode group = null;

            if (IsWiiU)
            {
                group = GetOrCreateFolder <FSHU>(MaterialAnimation.AnimationType.ShaderParam);
            }
            else
            {
                group = GetOrCreateFolder <FMAA>(MaterialAnimation.AnimationType.ShaderParam);
            }

            group.Import(ofd.FileNames, GetResFile(), GetResFileU());
            AddFolder(group);
        }
Esempio n. 17
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);
            }
        }
Esempio n. 18
0
        public BFRESGroupNode GetOrCreateFolder <T>(object CheckAnimEffect = null) where T : STGenericWrapper
        {
            BFRESGroupNode group = new BFRESGroupNode(IsWiiU);

            if (typeof(T) == typeof(FSKA))
            {
                group.Type = BRESGroupType.SkeletalAnim;
            }
            if (typeof(T) == typeof(FMAA))
            {
                group.Type = BRESGroupType.MaterialAnim;
            }
            if (typeof(T) == typeof(FSHU))
            {
                group.Type = BRESGroupType.ShaderParamAnim;
            }
            if (typeof(T) == typeof(FVIS))
            {
                group.Type = BRESGroupType.BoneVisAnim;
            }
            if (typeof(T) == typeof(FSHA))
            {
                group.Type = BRESGroupType.ShapeAnim;
            }
            if (typeof(T) == typeof(FSCN))
            {
                group.Type = BRESGroupType.SceneAnim;
            }
            if (typeof(T) == typeof(FTXP))
            {
                group.Type = BRESGroupType.TexPatAnim;
            }

            if (CheckAnimEffect != null)
            {
                if (CheckAnimEffect is MaterialAnimation.AnimationType)
                {
                    var type = (MaterialAnimation.AnimationType)CheckAnimEffect;

                    if (type == MaterialAnimation.AnimationType.Color)
                    {
                        group.Type = BRESGroupType.ColorAnim;
                    }
                    if (type == MaterialAnimation.AnimationType.TextureSrt)
                    {
                        group.Type = BRESGroupType.TexSrtAnim;
                    }
                    if (type == MaterialAnimation.AnimationType.ShaderParam)
                    {
                        group.Type = BRESGroupType.ShaderParamAnim;
                    }
                    if (type == MaterialAnimation.AnimationType.TexturePattern)
                    {
                        group.Type = BRESGroupType.TexPatAnim;
                    }
                    if (type == MaterialAnimation.AnimationType.Visibilty)
                    {
                        group.Type = BRESGroupType.MatVisAnim;
                    }
                }
                if (CheckAnimEffect is VisibiltyAnimType)
                {
                    var type = (VisibiltyAnimType)CheckAnimEffect;

                    if (type == VisibiltyAnimType.Bone)
                    {
                        group.Type = BRESGroupType.BoneVisAnim;
                    }
                    if (type == VisibiltyAnimType.Material)
                    {
                        group.Type = BRESGroupType.MatVisAnim;
                    }
                }
            }
            group.SetNameByType();

            foreach (BFRESGroupNode node in Nodes)
            {
                if (node.Type == group.Type)
                {
                    return(node);
                }
            }

            return(group);
        }
Esempio n. 19
0
 public void AddNode(BFRESGroupNode node)
 {
     Nodes.Add(node);
 }