public void Load(IReadOnlyList <string> args) { #if !DEBUG_PROGRAM try #endif { GameStructure = GameStructure.Load(args); Validate(); string exportPath = Path.Combine("Ripped", GameStructure.Name); PrepareExportDirectory(exportPath); #if DEBUG EngineAssetExporter engineExporter = new EngineAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Material, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Mesh, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, engineExporter); #endif GameStructure.Export(exportPath, AssetSelector); Logger.Log(LogType.Info, LogCategory.General, "Finished"); } #if !DEBUG_PROGRAM catch (Exception ex) { Logger.Log(LogType.Error, LogCategory.General, ex.ToString()); } #endif }
private void ExportFiles(object data) { m_exportPath = (string)data; PrepareExportDirectory(m_exportPath); TextureAssetExporter textureExporter = new TextureAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Cubemap, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, new ShaderAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.AudioClip, new AudioAssetExporter()); EngineAssetExporter engineExporter = new EngineAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Material, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Mesh, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, engineExporter); GameStructure.Export(m_exportPath, AssetSelector); Logger.Instance.Log(LogType.Info, LogCategory.General, "Finished!!!"); Dispatcher.Invoke(() => { IntroText.Text = "Export is finished"; ExportButton.Visibility = Visibility.Hidden; PostExportButton.Visibility = Visibility.Visible; ResetButton.Visibility = Visibility.Visible; } ); }
private void ExportFiles(object data) { m_exportPath = (string)data; PrepareExportDirectory(m_exportPath); TextureAssetExporter textureExporter = new TextureAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Cubemap, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, new ShaderAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.TextAsset, new TextAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.AudioClip, new AudioAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, new FontAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.MovieTexture, new MovieTextureAssetExporter()); EngineAssetExporter engineExporter = new EngineAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Material, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Mesh, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.MonoBehaviour, engineExporter); #if !DEBUG try #endif { GameStructure.Export(m_exportPath, AssetSelector); } #if !DEBUG catch (SerializedFileException ex) { ReportCrash(ex); return; } catch (Exception ex) { ReportCrash(ex); return; } #endif Logger.Log(LogType.Info, LogCategory.General, "Finished!!!"); Dispatcher.Invoke(() => { IntroText.Text += "Export is finished"; ExportButton.Visibility = Visibility.Hidden; PostExportButton.Visibility = Visibility.Visible; ResetButton.Visibility = Visibility.Visible; } ); }
private void ExportFiles(object data) { m_exportPath = (string)data; PrepareExportDirectory(m_exportPath); TextureAssetExporter textureExporter = new TextureAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Cubemap, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, textureExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, new ShaderAssetExporter()); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.AudioClip, new AudioAssetExporter()); EngineAssetExporter engineExporter = new EngineAssetExporter(); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Material, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Mesh, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, engineExporter); GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, engineExporter); #if !DEBUG try #endif { GameStructure.Export(m_exportPath, AssetSelector); } #if !DEBUG catch (SerializedFileException ex) { Logger.Log(LogType.Error, LogCategory.Import, ex.ToString()); Dispatcher.Invoke(() => { AddHyperlinkToConsole("Go to: ", "Create issue", IssuePage); AddHyperlinkToConsole("Attach file: ", ex.FileName, ex.FilePath); MessageBox.Show(this, $"Please, create an issue on github page {IssuePage} with attached file '{ex.FilePath}'.", "An error during export process has occuered!", MessageBoxButton.OK, MessageBoxImage.Error); }); return; } catch (Exception ex) { Logger.Log(LogType.Error, LogCategory.Import, ex.ToString()); Dispatcher.Invoke(() => { AddHyperlinkToConsole("Go to: ", "Create issue", IssuePage); MessageBox.Show(this, $"Please, create an issue on github page {IssuePage} with attached file that cause this error.", "An error during loading process has occuered!", MessageBoxButton.OK, MessageBoxImage.Error); }); return; } #endif Logger.Log(LogType.Info, LogCategory.General, "Finished!!!"); Dispatcher.Invoke(() => { IntroText.Text = "Export is finished"; ExportButton.Visibility = Visibility.Hidden; PostExportButton.Visibility = Visibility.Visible; ResetButton.Visibility = Visibility.Visible; } ); }
public void rip(string[] args, string targetDir) { Logger.Instance = PythonLogger.Instance; Config.IsAdvancedLog = true; Config.IsGenerateGUIDByContent = false; Config.IsExportDependencies = true; if (args.Length == 0) { Console.WriteLine("No arguments"); return; } foreach (string arg in args) { if (FileMultiStream.Exists(arg)) { continue; } if (DirectoryUtils.Exists(arg)) { continue; } Console.WriteLine(FileMultiStream.IsMultiFile(arg) ? $"File '{arg}' doesn't has all parts for combining" : $"Neither file nor directory with path '{arg}' exists"); return; } try { GameStructure = GameStructure.Load(args); Validate(); // MRH - can make this an option to include/exclude. Including will transcode, e.g. fsb (FSB5) into wav GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.AudioClip, new AudioAssetExporter()); /* MRH - borrowing from the GUI... there seems to be much more work there than in the CLI * uTinyRipperGUI.Exporters.TextureAssetExporter textureExporter = new uTinyRipperGUI.Exporters.TextureAssetExporter(); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, textureExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Cubemap, textureExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, textureExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, new uTinyRipperGUI.Exporters.ShaderAssetExporter()); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.TextAsset, new TextAssetExporter()); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, new FontAssetExporter()); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.MovieTexture, new MovieTextureAssetExporter()); * * EngineAssetExporter engineExporter = new EngineAssetExporter(); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Material, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Texture2D, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Mesh, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Shader, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Font, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.Sprite, engineExporter); * GameStructure.FileCollection.Exporter.OverrideExporter(ClassIDType.MonoBehaviour, engineExporter); * * PrepareExportDirectory(targetDir); */ GameStructure.Export(targetDir, AssetSelector); Logger.Log(LogType.Info, LogCategory.General, "Finished"); } catch (Exception ex) { Logger.Log(LogType.Error, LogCategory.General, ex.ToString()); } }
private void Export() { Util.PrepareExportDirectory(ExportPath); m_GameStructure.Export(ExportPath, (asset) => true); }
private void Export() { Util.PrepareExportDirectory(ExportPath); m_GameStructure.Export(ExportPath, Filter); }