Beispiel #1
0
        public override void Export(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfska")
            {
                if (GetResFileU() != null)
                {
                    SkeletalAnimU.Export(FileName, GetResFileU());
                }
                else
                {
                    SkeletalAnim.Export(FileName, GetResFile());
                }
            }
            else if (ext == ".chr0")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (SkeletalAnimU != null)
                {
                    BrawlboxHelper.FSKAConverter.Fska2Chr0(BfresPlatformConverter.FSKAConvertWiiUToSwitch(SkeletalAnimU), FileName);
                }
                else
                {
                    BrawlboxHelper.FSKAConverter.Fska2Chr0(SkeletalAnim, FileName);
                }
            }
            else if (ext == ".smd")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    SMD.Save(this, skeleton, FileName);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
            else if (ext == ".anim")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    ANIM.CreateANIM(FileName, this, skeleton);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
            else if (ext == ".seanim")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    SEANIM.SaveAnimation(FileName, this, skeleton);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
            else if (ext == ".json")
            {
                if (SkeletalAnimU != null)
                {
                    System.IO.File.WriteAllText(FileName, Newtonsoft.Json.JsonConvert.SerializeObject(SkeletalAnimU,
                                                                                                      Newtonsoft.Json.Formatting.Indented));
                }
                else
                {
                    System.IO.File.WriteAllText(FileName, Newtonsoft.Json.JsonConvert.SerializeObject(SkeletalAnim,
                                                                                                      Newtonsoft.Json.Formatting.Indented));
                }
            }
        }
Beispiel #2
0
        public override void Export(string FileName)
        {
            string ext = Utils.GetExtension(FileName);

            if (ext == ".bfska")
            {
                if (GetResFileU() != null)
                {
                    SkeletalAnimU.Export(FileName, GetResFileU());
                }
                else
                {
                    SkeletalAnim.Export(FileName, GetResFile());
                }
            }
            else if (ext == ".chr0")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (SkeletalAnimU != null)
                {
                    BrawlboxHelper.FSKAConverter.Fska2Chr0(BfresPlatformConverter.FSKAConvertWiiUToSwitch(SkeletalAnimU), FileName);
                }
                else
                {
                    BrawlboxHelper.FSKAConverter.Fska2Chr0(SkeletalAnim, FileName);
                }

                //  BrawlboxHelper.FSKAConverter.Fska2Chr0(this, skeleton, FileName);
            }
            else if (ext == ".smd")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    SMD.Save(this, skeleton, FileName);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
            else if (ext == ".anim")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    ANIM.CreateANIM(FileName, this, skeleton);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
            else if (ext == ".seanim")
            {
                STSkeleton skeleton = GetActiveSkeleton();

                if (skeleton != null)
                {
                    SEANIM.SaveAnimation(FileName, this, skeleton);
                }
                else
                {
                    throw new Exception("No skeleton found to assign!");
                }
            }
        }