Exemple #1
0
 private bool loadMD5Anim(string fileName)
 {
     md5anim = new MD5Anim();
     if (md5anim.loadMD5AnimFile(fileName))
     {
         md5anim = null;
         return(true);
     }
     lb_md5AnimName.Text = fileName;
     if (curFrame >= md5anim.getFrameCount())
     {
         curFrame = 0;
     }
     updateAnimStatusLabel();
     return(false);
 }
Exemple #2
0
        private void viewMd5Anim(string name)
        {
            MD5Anim na;

            try
            {
                na = new MD5Anim();
                if (na.loadMD5AnimFile(name))
                {
                    return;
                }
            }
            catch (System.IO.DirectoryNotFoundException ex)
            {
                MessageBox.Show("Failed to load .md5anim file '" + name + "' - directory not found exception.");
                return;
            }
            md5anim = na;

            refreshTreeView();
        }
Exemple #3
0
        private void mD5ModelAnimationPoseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // first ask user for md5mesh file
            openFileDialog1.Filter = "Doom3/Quake4 MD5mesh|*.md5mesh|All files (*.*)|*.*";
            openFileDialog1.Title  = "Open new model.";
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string   md5meshFileName = openFileDialog1.FileName;
            MD5Model md5             = new MD5Model();

            if (md5.loadMD5MeshFile(md5meshFileName))
            {
                return;
            }
            if (md5.getMeshCount() == 0)
            {
                MessageBox.Show("MD5 model you tried to import has no surfaces.",
                                "MD5 model has 0 surfaces.",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
                return;
            }
            // then ask user for md5anim file
            openFileDialog1.Filter = "Doom3/Quake4 MD5anim|*.md5anim|All files (*.*)|*.*";
            openFileDialog1.Title  = "Open new anim.";
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string md5animFileName = openFileDialog1.FileName;

#if false
            // then md5anim file
            FormImportMD5AnimatedFrame f = new FormImportMD5AnimatedFrame();
            f.setOBJViewerForm(this);
            f.ShowDialog();
#else
            MD5Anim anim = new MD5Anim();
            if (anim.loadMD5AnimFile(md5animFileName))
            {
                return;
            }
            if (anim.getFrameCount() == 0)
            {
                MessageBox.Show("MD5 model you tried to import has no surfaces.",
                                "MD5 model has 0 surfaces.",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
                return;
            }
            BoneOrientations bones = new BoneOrientations();
            bones.allocBones(anim.getJointCount());
            anim.buildFrameABSBones(0, bones);
            md5.buildVertices(bones);
            importMD5ModelMeshes(md5);
#endif
        }