public FileExplorer ShowExportModel() { if (_activeMainMenu != null) { _activeMainMenu.Close(); } if (_activeFileExplorer != null) { _activeFileExplorer.Close(); } _activeFileExplorer = FileManager.ExportModel(PrepreparedFileExplorer()); return(_activeFileExplorer); }
public void UpdateImage() { if (explorer != null) { explorer.Close(); } explorer = UIController.Instance.ShowRefPicture(); explorer.OnAccepted += (text) => { if (string.IsNullOrWhiteSpace(text)) { return; } SetPicture(text); explorer.Close(); }; }
public static FileExplorer SaveModel(FileExplorer script) { script.mode = FileExplorerMode.Save; script.UpdateDirectory(); script.OnAccepted += (text) => { if (System.String.IsNullOrWhiteSpace(text)) { return; } JsonSerializer.Serialize(text); script.Close(); }; return(script); }
public static FileExplorer ExportModel(FileExplorer script) { script.mode = FileExplorerMode.Save; script.UpdateDirectory(); script.OnAccepted += (text) => { if (System.String.IsNullOrWhiteSpace(text)) { return; } TranslateModelToObj(text); script.Close(); }; return(script); }
public static FileExplorer LoadModel(FileExplorer script) { script.mode = FileExplorerMode.Open; script.SetExtensionsArray(new string[] { ".abs" }); script.UpdateDirectory(); script.OnAccepted += (text) => { if (System.String.IsNullOrWhiteSpace(text)) { return; } JsonSerializer.Deserialize(text); script.Close(); }; return(script); }
public static FileExplorer ImportModel(FileExplorer script) { script.mode = FileExplorerMode.Open; script.SetExtensionsArray(new string[] { ".obj" }); script.UpdateDirectory(); script.OnAccepted += (text) => { if (System.String.IsNullOrWhiteSpace(text)) { return; } try { MeshToSdfGpu.TemporaryMesh mesh = TranslateObjToModel(text); MeshToSdfGpu.TranslateTrianglesToSdf(mesh, mesh.triangles.Length / 9, true); } catch { UIController.Instance.ShowMessageBox("Model could not be loaded - incorrect file format"); } script.Close(); }; return(script); }