public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken) { if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem) { return(MeshExport.ExportMesh(libraryItem, outputPath)); } return(Task.FromResult(false)); }
public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath) { if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem) { return(MeshExport.ExportMesh(libraryItem, outputPath)); } return(Task.FromResult(false)); }
public async Task <List <ValidationError> > Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken) { var firstItem = libraryItems.OfType <ILibraryAsset>().FirstOrDefault(); if (firstItem is ILibraryAsset libraryItem) { if (MeshExport.ExportMesh(libraryItem, outputPath).Result) { return(null); } } return(new List <ValidationError>() { new ValidationError() { Error = "Item cannot be exported as STL".Localize(), Details = firstItem?.ToString() ?? "" } }); }