16-01-2019, 08:33 AM
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();
}
}
}