private static void ProcessFolder(string inputFolder, string outputFile, bool logs, bool debug) { string folder = Path.GetFullPath(inputFolder); List <string> files = Directory.GetFiles(folder).ToList(); List <VoxModel> models = new List <VoxModel>(); VoxReader reader = new VoxReader(); Console.WriteLine("[LOG] Started to read all vox files at path: " + folder); foreach (string file in files) { if (Path.GetExtension(file) == ".vox") { Console.WriteLine("[LOG] Started to load model: " + file); models.Add(reader.LoadModel(file)); } } VoxWriterCustom writer = new VoxWriterCustom(); if (outputFile.Contains(".vox")) { writer.WriteModel(outputFile, models); reader.LoadModel(outputFile, logs, debug); } else { writer.WriteModel(outputFile + ".vox", models); reader.LoadModel(outputFile + ".vox", logs, debug); } }
private static void ReadVoxelModels(List <string> files, ProgramOptions programOptions) { List <VoxModel> models = new List <VoxModel>(); VoxReader reader = new VoxReader(); foreach (string file in files.Where(file => Path.GetExtension(file) == ".vox")) { Console.WriteLine("[LOG] Started to load model: " + file); models.Add(reader.LoadModel(file, false, false, false, false)); } VoxWriterCustom writer = new VoxWriterCustom(); if (models.Count == 0) { Console.WriteLine("[ERR] No models founds! Abort."); } else { writer.WriteModel(programOptions.GetSageOutputFile(), models); if (programOptions.EnableDebug) { reader.LoadModel(programOptions.OutputFile, programOptions.EnableLogs, true); } } }