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); } }
public void Replace(string FileName, ResFile resFileNX, ResU.ResFile resFileU) { string ext = Utils.GetExtension(FileName); if (ext == ".bfska") { bool IsSwitch = BfresUtilies.IsSubSectionSwitch(FileName); if (resFileU != null) { //If it's a switch animation try to conver it to wii u if (IsSwitch) { var ska = new SkeletalAnim(); ska.Import(FileName); SkeletalAnimU = BfresPlatformConverter.FSKAConvertSwitchToWiiU(ska); SkeletalAnimU.Name = Text; LoadAnim(SkeletalAnimU); } else { SkeletalAnimU.Import(FileName, resFileU); SkeletalAnimU.Name = Text; LoadAnim(SkeletalAnimU); } } else { if (IsSwitch) { SkeletalAnim.Import(FileName); SkeletalAnim.Name = Text; LoadAnim(SkeletalAnim); } else { //Create a new wii u skeletal anim and try to convert it instead var ska = new ResU.SkeletalAnim(); ska.Import(FileName, new ResU.ResFile()); SkeletalAnim = BfresPlatformConverter.FSKAConvertWiiUToSwitch(ska); SkeletalAnim.Name = Text; LoadAnim(SkeletalAnim); } } } else if (ext == ".anim") { FromAnim(FileName); } else if (ext == ".seanim") { STSkeleton skeleton = GetActiveSkeleton(); if (skeleton != null) { var ska = FromGeneric(SEANIM.Read(FileName, skeleton)); ska.Loop = this.CanLoop; UpdateAnimation(ska); } else { STErrorDialog.Show("No matching skeleton bones found to assign!", "Skeleton Importer", ""); } } else if (ext == ".smd") { STSkeleton skeleton = GetActiveSkeleton(); if (skeleton != null) { var ska = FromGeneric(SMD.Read(FileName, skeleton)); ska.Loop = this.CanLoop; UpdateAnimation(ska); } else { STErrorDialog.Show("No matching skeleton bones found to assign!", "Skeleton Importer", ""); } } else if (ext == ".chr0") { FromChr0(FileName, resFileU != null); } else if (ext == ".dae") { // FromAssimp(FileName, resFileU != null); } else if (ext == ".fbx") { // FromAssimp(FileName, resFileU != null); } }