Пример #1
0
 public FileExplorer ShowExportModel()
 {
     if (_activeMainMenu != null)
     {
         _activeMainMenu.Close();
     }
     if (_activeFileExplorer != null)
     {
         _activeFileExplorer.Close();
     }
     _activeFileExplorer = FileManager.ExportModel(PrepreparedFileExplorer());
     return(_activeFileExplorer);
 }
Пример #2
0
 public void UpdateImage()
 {
     if (explorer != null)
     {
         explorer.Close();
     }
     explorer             = UIController.Instance.ShowRefPicture();
     explorer.OnAccepted += (text) =>
     {
         if (string.IsNullOrWhiteSpace(text))
         {
             return;
         }
         SetPicture(text);
         explorer.Close();
     };
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }
Пример #5
0
 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);
 }
Пример #6
0
 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);
 }