Jump to content

Command Line Tools

From SA Docs

Introduction

In addition to GUI tools like Texture Editor and SAMDL, SA Tools include several command line tools useful for scripting and other purposes.

These tools are located in SA Tools\bin. They are meant to be used with Windows Terminal or the command prompt (cmd.exe).

List of Tools

Tool Purpose
AnimJSONConverter Converts .saanim files to .json and vice versa
ArchiveTool Extracts and builds PVM/GVM/PRS/DAT and other archives, extracts PB archives
buildEvent Builds SA2 event files
buildMDL Builds SA2 MDL files
buildMiniEvent Builds SA2 in-level cutscenes
buildMTN Builds SA2 MTN files
BuildShapeMotion Creates Ninja Shape animations
ModelConverter Converts .sa1mdl files to .sa2mdl and vice versa
ModelRelabeler Copies labels from one model file to another
PAKTool Extracts and builds .PAK archives
SETCodeGenerator Creates object loading code from a SET file and an object list
split Extracts data from binary files
splitEvent Extracts data from SA2 event files
splitMiniEvent Extracts data from SA2 in-level cutscenes
splitMTN Extracts data from SA2 MTN files
splitShapeMotion Extracts data from Ninja Shape animations
TextureRemap Remaps texture IDs in a model file
WeldConverter Converts a model's vertex welds to a custom weight format

Adding the PATH Environment Variable

To make using command line tools easier, add the bin folder to your system PATH environment variable.

Go to System Properties, Advanced and Click "Environment Variables...". You will see the following window:

Select Path in in User Variables and click "Edit...". Then click New and type the location of your SA Tools' bin folder. Example:

You can now run the tools from any folder in the command prompt.

Examples and Usage

One way to launch the command prompt in the folder you need is opening the folder in Explorer and typing cmd in the address bar:

Hit Enter and you can now use the command line tools in this folder:

To learn how to use a specific tool, run it without command line arguments.

Example: Scanning SA1 STG01.PRS for levels and models using the Object Scanner. Type the following in the command prompt and press Enter:

objscan SA1 STG01.PRS C900000 all

Note: the file STG01.PRS must exist in the folder you're running the command in (D:\test in this example).

SA Tools Information
General Tools SALVLSAMDLSAFontEditTexture EditorData ToolboxSA Tools Hub
Sonic Adventure (DX) Tools SADXTweaker2SADXSndSharpSASavePL ToolVMS Editor
Sonic Adventure 2 (Battle) Tools SA2 Event ViewerSA2 Cutscene Text EditorSA2 Message File EditorSA2 Stage Select EditorSA2 Cutscene Effect EditorSA2 Light/Fog Editor
Other Command Line ToolsWorking with Binary Files