示例#1
0
        //private void button1_Click(object sender, EventArgs e)
        //{

        //    //This code will copy the rotation/location data to another loaded file (used to copy the data from the weapon file I used to set the rotations to the character file used to preview the mesh)

        //    for (int i = 0; i < 80; i++)
        //    {
        //        _selectedRefImage = _refLibrary.GetMImage(i);
        //        _selectedHandImage = _handLibrary.GetMImage(i);
        //        _selectedRefImage.RotationX = _selectedHandImage.RotationX;
        //        _selectedRefImage.RotationY = _selectedHandImage.RotationY;
        //        _selectedRefImage.RotationZ = _selectedHandImage.RotationZ;
        //        _selectedRefImage.MoveX = _selectedHandImage.MoveX;
        //        _selectedRefImage.MoveY = _selectedHandImage.MoveY;
        //    }



        //    //quick button to remove the image for frames I need to be blanked out
        //    //_refLibrary.ReplaceImage((int)nud_frame.Value, null, 0, 0);

        //    Render();
        //}

        //This code will duplicate the rotation/location data from the male to female frames to save some time setting the files up (it is set as 416 for the CWeapons(Mir2 War/Wiz/Tao))
        //private void button_duplicate416_Click(object sender, EventArgs e)
        //{
        //    for(int x = 0; x < 416; x++)
        //    {
        //        _selectedRefImage = _refLibrary.GetMImage(x);
        //        float tmovex = _selectedRefImage.MoveX;
        //        float tmovey = _selectedRefImage.MoveY;
        //        float trotx = _selectedRefImage.RotationX;
        //        float troty = _selectedRefImage.RotationY;
        //        float trotz = _selectedRefImage.RotationZ;
        //        _selectedRefImage = _refLibrary.GetMImage(x + 416);
        //        _selectedRefImage.MoveX = tmovex;
        //        _selectedRefImage.MoveY = tmovey;
        //        _selectedRefImage.RotationX = trotx;
        //        _selectedRefImage.RotationY = troty;
        //        _selectedRefImage.RotationZ = trotz;
        //    }
        //}


        private void Btn_ExportLib_Click(object sender, EventArgs e)
        {
            //Really small Images may break this as I've not added checks for creating images that are 0 pixels width or height

            //create a new Library to store everything as each frame is rendered and saved
            if (_library != null)
            {
                _library.Close();
            }
            _library = new MLibraryV2("", false);

            //open saveFileDialog so the user can select a file name for the new .lib file
            saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "CompletedLibs";
            saveFileDialog.AddExtension     = true;
            saveFileDialog.DefaultExt       = ".lib";

            if (saveFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            _library.FileName = saveFileDialog.FileName;

            toolStripProgressBar.Maximum = Convert.ToInt16(text_test_framemax.Text);
            toolStripProgressBar.Step    = (Convert.ToInt16(text_test_framemax.Text) - Convert.ToInt16(text_test_framemin.Text)) / 20;

            t1 = new Thread(ExportThread);
            //t1.IsBackground = true; //setting as background stops the infinite looped thread when main app is closed
            t1.Start();
        }
示例#2
0
        private void Btn_ImportLib_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "Data";
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            _selectedRefImage = null;

            //open reference file character images
            if (_refLibrary != null)
            {
                _refLibrary.Close();
            }
            _refLibrary = new MLibraryV2(openFileDialog1.FileName, true);

            //open Library containing the hand images if file exists
            //I can't get this to work this way... seems access to file is denied when I check if file exists so it always returns false
            //string hfilename = Path.GetDirectoryName(openFileDialog1.FileName) + @"\" + Path.GetFileNameWithoutExtension(openFileDialog1.FileName) + "_Hands.Lib";
            //if (_handLibrary != null) _handLibrary.Close();
            //if (File.Exists(hfilename)) _handLibrary = new MLibraryV2(hfilename);

            //set number up down control max value and default back to frame 0
            nud_frame.Maximum = _refLibrary.Count - 1;
            nud_frame.Value   = 0;

            //set the min and max frames so the user does not need to render every frame each time if only editing a few frames (and importing them to another file using Library editor)
            text_test_framemax.Text = _refLibrary.Count.ToString();
            text_test_framemin.Text = "0";

            UpdateTextBoxes();
            Render();
        }
示例#3
0
        private void Btn_OpenHandRef_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + @"Data\Hands";
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            _selectedHandImage = null;

            if (_handLibrary != null)
            {
                _handLibrary.Close();
            }
            _handLibrary = new MLibraryV2(openFileDialog1.FileName, false);

            Lbl_HandRefName.Text = Path.GetFileName(_handLibrary.FileName);
        }
示例#4
0
        private void Main_Load(object sender, EventArgs e)
        {
            //Starts a Thread that updates the DirectX panel
            //t1 = new Thread(Loop);
            //t1.IsBackground = true; //setting as background stops the infinite looped thread when main app is closed
            //t1.Start();

            //Load Reference File for the naked character images (default to Mir2 War/WizTao)
            if (_refLibrary != null)
            {
                _refLibrary.Close();
            }
            _refLibrary = new MLibraryV2(characterTypeFileName, true);

            nud_frame.Maximum = _refLibrary.Count - 1; //-1 as Frame number and number up down control is zero based
            nud_frame.Value   = 0;

            text_test_framemax.Text = _refLibrary.Count.ToString();
            text_test_framemin.Text = "0";

            UpdateTextBoxes();
        }