ImportPSA() public méthode

public ImportPSA ( string path ) : void
path string
Résultat void
Exemple #1
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenFileDialog d = new OpenFileDialog();
     d.Filter = "*.psa|*.psa";
     if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         string path = d.FileName;
         psa = new PSAFile();
         psa.ImportPSA(path);
         CurrFile = path;
         RefreshTree();
     }
 }
Exemple #2
0
 public bool ImportFromPSA(string path)
 {
     PSAFile psa = new PSAFile();
     psa.ImportPSA(path);
     PSAFile.PSAData d = psa.data;
     DebugOutput.PrintLn("Checking data...");
     if (d.Bones.Count != SetData.TrackBoneNames.Count)
     {
         MessageBox.Show("Cant import: different count of bones");
         return false;
     }
     for (int i = 0; i < SetData.TrackBoneNames.Count; i++)
         if (d.Bones[i].name != SetData.TrackBoneNames[i])
         {
             MessageBox.Show("Cant import: couldnt match all bones");
             return false;
         }
     if (d.Infos.Count != Sequences.Count)
     {
         MessageBox.Show("Cant import: different count of sequences");
         return false;
     }
     for (int i = 0; i < Sequences.Count; i++)
     {
         AnimSequence ans = new AnimSequence(pcc, Sequences[i]);
         if (d.Infos[i].name != pcc.getNameEntry(ans.SequenceName))
         {
             MessageBox.Show("Cant import: couldnt match all sequences");
             return false;
         }
     }
     int pos = 0;
     for (int i = 0; i < Sequences.Count; i++)
     {
         DebugOutput.PrintLn("Importing into AnimSequence #" + Sequences[i] + " ...");
         AnimSequence ans = new AnimSequence(pcc, Sequences[i]);
         PSAFile.PSAAnimInfo inf = d.Infos[i];
         List<Vector3> loc = new List<Vector3>();
         List<Vector4> rot = new List<Vector4>();
         for (int j = 0; j < inf.TotalBones; j++)
         {
             PSAFile.PSAAnimKeys key = d.Keys[pos + j];
             loc.Add(key.location.ToVector3());
             rot.Add(key.rotation.ToVector4());
         }
         ans.ImportKeys(loc.ToArray(), rot.ToArray(), inf.NumRawFrames);
         ans.SaveChanges();
         pos += inf.KeyQuotum;
     }
     pcc.save();
     return true;
 }