Exemplo n.º 1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            if (mesh == null)
            {
                return;
            }
            SaveFileDialog d = new SaveFileDialog();

            d.Filter = "*.psk|*.psk";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                PSKFile psk = new PSKFile(mesh);
                psk.Export(d.FileName);
                MessageBox.Show("Done.");
            }
        }
Exemplo n.º 2
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (psk == null)
            {
                return;
            }
            SaveFileDialog d = new SaveFileDialog();

            d.Filter = "*.psk|*.psk;*.pskx";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string path = d.FileName;
                psk.Export(path);
                MessageBox.Show("Done.");
            }
        }
Exemplo n.º 3
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     if (mesh == null)
         return;
     SaveFileDialog d = new SaveFileDialog();
     d.Filter = "*.psk|*.psk";
     if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         PSKFile psk = new PSKFile(mesh);
         psk.Export(d.FileName);
         MessageBox.Show("Done.");
     }
 }
Exemplo n.º 4
0
 public void ExportToPsk(string path,int LOD)
 {
     PSKFile.PSKContainer pskc = new PSKFile.PSKContainer();
     LOD l = Mesh.LODs[LOD];
     pskc = WriteBones(pskc);
     pskc = WriteWeights(pskc,LOD);
     pskc.points = new List<PSKFile.PSKPoint>();
     pskc.edges = new List<PSKFile.PSKEdge>();            
     for (int i = 0; i < l.Edges.Count; i++)
     {
         Edge e =l.Edges[i];
         Vector3 p = e.Position;
         p.Y *= -1;
         pskc.points.Add(new PSKFile.PSKPoint(p));
         pskc.edges.Add(new PSKFile.PSKEdge((short)i,e.UV,0));
     }
     pskc.faces = new List<PSKFile.PSKFace>();
     foreach (LODHeader h in l.Headers)
     {
         for (int i = 0; i < h.count; i++)
         {
             PSKFile.PSKFace f = new PSKFile.PSKFace(l.Indexes[(int)h.offset + i * 3],
                                                l.Indexes[(int)h.offset + i * 3 + 2],
                                                l.Indexes[(int)h.offset + i * 3 + 1],  
                                                (byte)h.matindex);
             pskc.faces.Add(f);
             PSKFile.PSKEdge e = pskc.edges[f.v0];
             e.material = (byte)h.matindex;
             pskc.edges[f.v0] = e;
             e = pskc.edges[f.v1];
             e.material = (byte)h.matindex;
             pskc.edges[f.v1] = e;
             e = pskc.edges[f.v2];
             e.material = (byte)h.matindex;
             pskc.edges[f.v2] = e;
         }
     }
     
     pskc.materials = new List<PSKFile.PSKMaterial>();
     foreach (int i in Mesh.Materials)
         pskc.materials.Add(new PSKFile.PSKMaterial(pcc.getObjectName(i), 0));
     psk = new PSKFile();
     psk.psk = pskc;
     psk.Export(path);
 }