protected override WriteFileResult WriteFile(string filename, int index, RhinoDoc doc, FileWriteOptions options) { bool binary = GlTFUtils.IsFileGltfBinary(filename); if (!UseSavedSettingsDontShowDialog) { ExportOptionsDialog optionsDlg = new ExportOptionsDialog(); optionsDlg.RestorePosition(); Eto.Forms.DialogResult result = optionsDlg.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow); if (result != Eto.Forms.DialogResult.Ok) { return(WriteFileResult.Cancel); } } glTFExportOptions exportOptions = glTFBinExporterPlugin.GetSavedOptions(); IEnumerable <Rhino.DocObjects.RhinoObject> objects = GetObjectsToExport(doc, options); if (!GlTFExporterCommand.DoExport(filename, exportOptions, binary, doc, objects, doc.RenderSettings.LinearWorkflow)) { return(WriteFileResult.Failure); } return(WriteFileResult.Success); }
protected override WriteFileResult WriteFile(string filename, int index, RhinoDoc doc, FileWriteOptions options) { bool binary = GlTFUtils.IsFileGltfBinary(filename); glTFExportOptions gltfOptions = new glTFExportOptions(); gltfOptions.UseBinary = binary; ExportOptionsDialog optionsDlg = new ExportOptionsDialog(gltfOptions); if (optionsDlg.ShowModal() == null) { return(WriteFileResult.Cancel); } IEnumerable <Rhino.DocObjects.RhinoObject> objects = GetObjectsToExport(doc, options); GlTFExporterCommand.DoExport(filename, gltfOptions, objects, doc.RenderSettings.LinearWorkflow); return(WriteFileResult.Success); }