static IEnumerable <string> NodeCacheDirs(string CacheDir) { foreach (var nodeRoot in Directory.GetDirectories(CacheDir)) { yield return(Meshroom.GetNodeCacheDir(nodeRoot)); } }
static void WaitForCamInitDir(string path) { var camInitRoot = Path.Combine(path, "CameraInit"); while (!Directory.Exists(camInitRoot)) { Thread.Sleep(500); } string nodeDir; while ((nodeDir = Meshroom.GetNodeCacheDir(camInitRoot)) == null) { Thread.Sleep(1500); } string statusFile = Path.Combine(nodeDir, "status"); while (!File.Exists(statusFile)) { Thread.Sleep(500); } while (!Status.isDone(statusFile)) { Thread.Sleep(500); } }
static void CopyCamerasSFMFile(string ImagesDir, string graphName) { var MeshroomCacheDir = Meshroom.GetCacheDir(ImagesDir); var SfmCacheDir = Meshroom.GetNodeCacheDir( Path.Combine(MeshroomCacheDir, "StructureFromMotion")); var camsSfmFile = Path.Combine(SfmCacheDir, "cameras.sfm"); var destFile = Path.Combine(ImagesDir, $"{graphName}.sfm"); File.Copy(camsSfmFile, destFile, true); }