AnimationEdit - Export all to VD

This is where you can discuss UOFiddler, by Turley.

Moderator: POL Developer

Post Reply
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am
Location: Livorno, Italy
Contact:

AnimationEdit - Export all to VD

Post by Gnafu »

Here's the code to export all the valid animations from the selected anim file.

Code: Select all

        private void OnClickExportAllToVD(object sender, EventArgs e)
        {
            if (FileType != 0)
            {
                using (FolderBrowserDialog dialog = new FolderBrowserDialog())
                {
                    dialog.Description = "Select directory";
                    dialog.ShowNewFolderButton = true;
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        for (int i = 0; i < treeView1.Nodes.Count; ++i)
                        {
                            int index = (int)treeView1.Nodes[i].Tag;
                            if (index >= 0 && treeView1.Nodes[i].Parent == null && treeView1.Nodes[i].ForeColor != Color.Red)
                            {

                                string FileName = Path.Combine(dialog.SelectedPath, String.Format("anim{0}_0x{1:X}.vd", FileType, index));
                                Ultima.AnimationEdit.ExportToVD(FileType, index, FileName);
                            }
                        }
                        MessageBox.Show(String.Format("All Animations saved to {0}", dialog.SelectedPath.ToString()),
                                "Export", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    }
                }
            }

        }
I put the button here
Image

It works well but it can be better... i'm working on it.

There is a problem with the memory management, maybe it's in the ultima sdk: when it saves the anim from a file it seems to not free the memory after closing each file, or when it ends.
So, if I try to export anims from another file the memory usage grows, and again with another file until it freeze and I must kill from Program Manager. I managed to export only from to files at time without seeing uofiddler freezing.
Post Reply