Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Positions Saving & Loading
#3
Thanks a lot! Now it works properly.


Code:
   void SaveAll()
   {
       //obiCloth.Solver.RequireRenderablePositions();
       obiCloth.PullDataFromSolver(ParticleData.POSITIONS);
       SaveDB(_xml3, s3, obiCloth.positions);
       //obiCloth.Solver.RelinquishRenderablePositions();
       Debug.Log("Saved");
   }

   public void LoadMesh()
   {
       if (obiCloth.InSolver)
       {
           obiCloth.PullDataFromSolver(ParticleData.POSITIONS);
           for (int i = 0; i < any.Length; i++)
           {
               obiCloth.positions[i] = any[i] + obiCloth.transform.localPosition;
           }
           obiCloth.PushDataToSolver(ParticleData.POSITIONS);
       }
   }

   public void LoadAll()
   {
       LoadAny(_xml3, s3, any);
       if (obiCloth != null)
       {
           if (obiCloth.Solver != null)
           {
               LoadMesh();
           }
       }
   }
Reply


Messages In This Thread
Positions Saving & Loading - by Loki_Priest - 16-01-2019, 05:03 AM
RE: Positions Saving & Loading - by josemendez - 16-01-2019, 08:22 AM
RE: Positions Saving & Loading - by Loki_Priest - 16-01-2019, 08:33 AM