SaveChanges() public méthode

public SaveChanges ( ) : void
Résultat void
Exemple #1
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.saveToFile();
            return(true);
        }
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;
 }