Exemplo n.º 1
0
        // Loading Mat
        private void loadPresetButton_Click(object sender, EventArgs e)
        {
            MaterialSelector matSelector = new MaterialSelector();

            matSelector.ShowDialog();
            if (matSelector.exitStatus == MaterialSelector.Opened)
            {
                FileData matFile = new FileData(matSelector.path);

                int soff = matFile.readInt();

                NUD.PolyData pol = new NUD.PolyData()
                {
                    texprop1 = matFile.readInt(),
                    texprop2 = matFile.readInt(),
                    texprop3 = matFile.readInt(),
                    texprop4 = matFile.readInt()
                };

                // Store the original material to preserve Tex IDs.
                NUD.Material original = currentPolygon.materials[0].Clone();

                currentPolygon.materials = NUD.ReadMaterials(matFile, pol, soff);

                // Copy the old Tex IDs.
                currentPolygon.materials[0].CopyTextureIds(original);

                currentMaterialList = currentPolygon.materials;
                currentMatIndex     = 0;
                Init();
                FillForm();
            }
        }
Exemplo n.º 2
0
        // Loading Mat
        private void button2_Click(object sender, EventArgs e)
        {
            MaterialSelector m = new MaterialSelector();

            m.ShowDialog();
            if (m.exitStatus == MaterialSelector.Opened)
            {
                FileData f = new FileData(m.path);

                int soff = f.readInt();

                NUD._s_Poly pol = new NUD._s_Poly()
                {
                    texprop1 = f.readInt(),
                    texprop2 = f.readInt(),
                    texprop3 = f.readInt(),
                    texprop4 = f.readInt()
                };

                int texid = poly.materials[0].textures[0].hash;
                poly.materials = NUD.readMaterial(f, pol, soff);
                poly.materials[0].textures[0].hash = texid;
                material = poly.materials;
                Console.WriteLine(material.Count);
                current = 0;
                Init();
                FillForm();
            }

            /*using (var ofd = new OpenFileDialog())
             * {
             *  ofd.Filter = "Namco Material (NMT)|*.nmt|" +
             *               "All files(*.*)|*.*";
             *
             *  if (ofd.ShowDialog() == DialogResult.OK)
             *  {
             *      if (ofd.FileName.EndsWith(".nmt"))
             *      {
             *          FileData f = new FileData(ofd.FileName);
             *
             *          int soff = f.readInt();
             *
             *          NUD._s_Poly pol = new NUD._s_Poly()
             *          {
             *              texprop1 = f.readInt(),
             *              texprop2 = f.readInt(),
             *              texprop3 = f.readInt(),
             *              texprop4 = f.readInt()
             *          };
             *
             *          poly.materials = NUD.readMaterial(f, pol, soff);
             *          material = poly.materials;
             *          Console.WriteLine(material.Count);
             *          current = 0;
             *          Init();
             *          FillForm();
             *      }
             *  }
             * }*/
        }
Exemplo n.º 3
0
        private void loadPresetButton_Click(object sender, EventArgs e)
        {
            MaterialSelector matSelector = new MaterialSelector();

            matSelector.ShowDialog();
            if (matSelector.exitStatus == MaterialSelector.ExitStatus.Opened)
            {
                List <NUD.Material> presetMaterials = ReadMaterialListFromPreset(matSelector.path);

                // Store the original material to preserve Tex IDs.
                NUD.Material original = currentPolygon.materials[0].Clone();
                currentPolygon.materials = presetMaterials;

                // Copy the old Tex IDs.
                currentPolygon.materials[0].CopyTextureIds(original);

                currentMaterialList = currentPolygon.materials;
                currentMatIndex     = 0;
                Init();
                FillForm();
            }
        }