private void exportAllAsANIMToolStripMenuItem_Click(object sender, EventArgs e) { using (var ofd = new FolderSelectDialog()) { ofd.Title = "Character Folder"; if (ofd.ShowDialog() == DialogResult.OK) { string path = ofd.SelectedPath; foreach (TreeNode b in treeView1.Nodes) { foreach (TreeNode v in b.Nodes) { foreach (TreeNode f in v.Nodes) { foreach (TreeNode a in f.Nodes) { if (a is Animation) { ANIM.CreateANIM(path + "\\" + a.Text + ".anim", ((Animation)a), Runtime.TargetVBN); } } } } } } } }
public void SaveAs(object sender, EventArgs args) { if (Runtime.TargetVBN == null) { MessageBox.Show("You must have a bone-set (VBN) selected to save animations."); return; } using (var sfd = new SaveFileDialog()) { sfd.Filter = "Supported Files (.omo, .anim, .smd)|*.omo;*.anim;*.smd|" + "Maya Anim (.anim)|*.anim|" + "Object Motion (.omo)|*.omo|" + "Source Animation (.smd)|*.smd|" + "All Files (*.*)|*.*"; sfd.DefaultExt = "smd"; //Set a default extension to prevent crashing if not specified by user if (sfd.ShowDialog() == DialogResult.OK) { sfd.FileName = sfd.FileName; if (sfd.FileName.EndsWith(".anim")) { if (Tag is AnimTrack) { ((AnimTrack)Tag).createANIM(sfd.FileName, Runtime.TargetVBN); } else { ANIM.CreateANIM(sfd.FileName, this, Runtime.TargetVBN); } } if (sfd.FileName.EndsWith(".omo")) { if (Tag is FileData) { FileOutput o = new FileOutput(); o.writeBytes(((FileData)Tag).getSection(0, ((FileData)Tag).size())); o.save(sfd.FileName); } else { File.WriteAllBytes(sfd.FileName, OMOOld.CreateOMOFromAnimation(this, Runtime.TargetVBN)); } } if (sfd.FileName.EndsWith(".smd")) { SMD.Save(this, Runtime.TargetVBN, sfd.FileName); } } } }
public void SaveAs(object sender, EventArgs args) { if (Runtime.TargetVBN == null) { MessageBox.Show("You must have a bone set (VBN) open before saving animations"); return; } using (var sfd = new SaveFileDialog()) { sfd.Filter = "Supported Files (.omo, .anim, .smd)|*.omo;*.anim;*.smd|" + "Maya Anim (.anim)|*.anim|" + "Object Motion (.omo)|*.omo|" + "Source Animation (.smd)|*.smd|" + "All Files (*.*)|*.*"; if (sfd.ShowDialog() == DialogResult.OK) { sfd.FileName = sfd.FileName; if (sfd.FileName.EndsWith(".anim")) { if (Tag is AnimTrack) { ((AnimTrack)Tag).createANIM(sfd.FileName, Runtime.TargetVBN); } else { ANIM.CreateANIM(sfd.FileName, this, Runtime.TargetVBN); } } if (sfd.FileName.EndsWith(".omo")) { if (Tag is FileData) { FileOutput o = new FileOutput(); o.writeBytes(((FileData)Tag).getSection(0, ((FileData)Tag).size())); o.save(sfd.FileName); } else { OMOOld.CreateOMOFromAnimation(this, Runtime.TargetVBN); } } if (sfd.FileName.EndsWith(".smd")) { SMD.Save(this, Runtime.TargetVBN, sfd.FileName); } } } }
public void SaveAsExpeditedAnim() { Console.WriteLine("Expedation taking effect"); if (Runtime.TargetVBN == null) // Showing the message box would pause execution which is not ideal. { return; } if (Tag is AnimTrack) { ((AnimTrack)Tag).createANIM(MainForm.executableDir + "\\animextractions\\" + Text + ".anim", Runtime.TargetVBN); } else { ANIM.CreateANIM(MainForm.executableDir + "\\animextractions\\" + Text + ".anim", this, Runtime.TargetVBN); } }