private IEnumerator _ExportModel(System.Action <int> UpdatePercentage = null, System.Action done = null) { ViveSR_RigidReconstruction.ExportAdaptiveMesh = true; ViveSR_RigidReconstruction.ExportModel(MeshName); int percentage = 0; if (CheckModelLoaded()) { Destroy(collisionMesh); Destroy(texturedMesh); collisionMesh = null; texturedMesh = null; } ViveSR_RigidReconstruction.GetExportProgress(ref percentage); while (percentage < 100) { int error = ViveSR_RigidReconstruction.GetExportProgress(ref percentage); if (error != (int)Error.WORK) { GPUMemoryFull(); break; } if (UpdatePercentage != null) { UpdatePercentage(percentage); } yield return(new WaitForEndOfFrame()); } ViveSR_DualCameraImageCapture.EnableDepthProcess(false); if (done != null) { done(); } }
private IEnumerator _ExportModel(System.Action <int> UpdatePercentage = null, System.Action done = null) { ViveSR_RigidReconstruction.ExportAdaptiveMesh = true; ViveSR_RigidReconstruction.ExportModel(MeshName); int percentage = 0; int lastPercentage = 0; if (CheckModelLoaded()) { Destroy(collisionMesh); Destroy(texturedMesh); collisionMesh = null; texturedMesh = null; } while (percentage < 100) { ViveSR_RigidReconstruction.GetExportProgress(ref percentage); if (UpdatePercentage != null) { UpdatePercentage(percentage); } // wait until saving is really processing then we disable depth if (lastPercentage == 0 && percentage > 0) { ViveSR_DualCameraImageCapture.EnableDepthProcess(false); } lastPercentage = percentage; yield return(new WaitForEndOfFrame()); } if (done != null) { done(); } }