public static CHR0Node FromFile(string path) { //string ext = Path.GetExtension(path); if (path.EndsWith(".chr0", StringComparison.OrdinalIgnoreCase)) { return(NodeFactory.FromFile(null, path) as CHR0Node); } try { if (path.EndsWith(".anim", StringComparison.OrdinalIgnoreCase)) { return(AnimFormat.Read(path)); } if (path.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)) { return(CHR0TextImporter.Convert(path)); } if (path.EndsWith(".json", StringComparison.OrdinalIgnoreCase)) { return(CHR0JsonImporter.Convert(path)); } //if (path.EndsWith(".bvh", StringComparison.OrdinalIgnoreCase)) // return BVH.Import(path); //if (path.EndsWith(".vmd", StringComparison.OrdinalIgnoreCase)) // return PMDModel.ImportVMD(path); } catch (System.Runtime.Serialization.SerializationException e) { MessageBox.Show("There was a problem importing the model animation.\n\nError:\n" + e.Message); } throw new NotSupportedException("The file extension specified is not of a supported animation type."); }
public override unsafe void Export(string outPath) { if (outPath.EndsWith(".dae", StringComparison.OrdinalIgnoreCase)) { Collada.Serialize(new CHR0Node[] { this }, 60.0f, false, outPath); } else if (outPath.EndsWith(".anim", StringComparison.OrdinalIgnoreCase)) { AnimFormat.Serialize(this, false, outPath); } else { base.Export(outPath); } }
public static CHR0Node FromFile(string path) { //string ext = Path.GetExtension(path); if (path.EndsWith(".chr0", StringComparison.OrdinalIgnoreCase)) { return(NodeFactory.FromFile(null, path) as CHR0Node); } if (path.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)) { return(CHR0TextImporter.Convert(path)); } if (path.EndsWith(".anim", StringComparison.OrdinalIgnoreCase)) { return(AnimFormat.Read(path)); } //if (path.EndsWith(".bvh", StringComparison.OrdinalIgnoreCase)) // return BVH.Import(path); //if (path.EndsWith(".vmd", StringComparison.OrdinalIgnoreCase)) // return PMDModel.ImportVMD(path); throw new NotSupportedException("The file extension specified is not of a supported animation type."); }
public static SkeletalAnim Anim2Fska(string FileName) { CHR0Node chr0 = AnimFormat.Read(FileName); return(Chr02Fska(chr0)); }