Пример #1
0
 private void exportAllAsSMDToolStripMenuItem_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)
                             {
                                 SMD.Save(((Animation)a), Runtime.TargetVBN, path + "\\" + a.Text + ".smd");
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #2
0
        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);
                    }
                }
            }
        }
Пример #3
0
        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);
                    }
                }
            }
        }