public void ReplaceAnimation(object sender, EventArgs args) { using (OpenFileDialog of = new OpenFileDialog()) { of.ShowDialog(); foreach (string filename in of.FileNames) { if (filename.EndsWith(".omo")) { Animation a = OMOOld.read(new FileData(filename)); a.Text = filename; ReplaceMe(a); } if (filename.EndsWith(".smd")) { Animation a = new Animation(filename.Replace(".smd", "")); Smd.Read(filename, a, Runtime.TargetVbn); ReplaceMe(a); } if (filename.EndsWith(".chr0")) { Animation a = (CHR0.read(new FileData(filename), Runtime.TargetVbn)); ReplaceMe(a); } if (filename.EndsWith(".anim")) { Animation a = (ANIM.read(filename, Runtime.TargetVbn)); ReplaceMe(a); } } } }
public void Import(object sender, EventArgs args) { using (OpenFileDialog fd = new OpenFileDialog()) { fd.Filter = "Supported Formats|*.omo;*.anim;*.chr0;*.smd;*.mta;|" + "Object Motion|*.omo|" + "Maya Animation|*.anim|" + "NW4R Animation|*.chr0|" + "Source Animation (SMD)|*.smd|" + "Smash 4 Material Animation (MTA)|*.mta|" + "All files(*.*)|*.*"; if (fd.ShowDialog() == DialogResult.OK) { foreach (string filename in fd.FileNames) { if (filename.EndsWith(".mta")) { MTA mta = new MTA(); try { mta.Read(filename); Runtime.MaterialAnimations.Add(filename, mta); Nodes.Add(filename); } catch (Exception) { mta = null; } } else if (filename.EndsWith(".smd")) { var anim = new Animation(filename); if (Runtime.TargetVbn == null) { Runtime.TargetVbn = new VBN(); } Smd.Read(filename, anim, Runtime.TargetVbn); Nodes.Add(anim); } if (filename.EndsWith(".omo")) { Animation a = OMOOld.read(new FileData(filename)); a.Text = filename; Nodes.Add(a); } if (filename.EndsWith(".chr0")) { Nodes.Add(CHR0.read(new FileData(filename), Runtime.TargetVbn)); } if (filename.EndsWith(".anim")) { Nodes.Add(ANIM.read(filename, Runtime.TargetVbn)); } } } } }