Command Line Tools: Difference between revisions
No edit summary |
mNo edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
In addition to GUI tools like Texture Editor and SAMDL, SA Tools include several command line tools useful for scripting and other purposes. | 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 <code>SA Tools\bin</code>. They are meant to be used with Windows Terminal or the command prompt (<code>cmd.exe</code>). | These tools are located in <code>SA Tools\bin</code>. They are meant to be used with Windows Terminal or the command prompt (<code>cmd.exe</code>). | ||
== List of | == List of Tools == | ||
{| class="wikitable" | {| class="wikitable" | ||
!Tool | !Tool | ||
| Line 10: | Line 10: | ||
|- | |- | ||
|AnimJSONConverter | |AnimJSONConverter | ||
|Converts .saanim files to .json and vice versa | |Converts .saanim files to .json and vice versa. | ||
|- | |- | ||
|ArchiveTool | |ArchiveTool | ||
|Extracts and builds PVM/GVM/PRS/DAT and other archives, extracts PB archives | |Extracts and builds PVM/GVM/PRS/DAT and other archives, extracts PB archives. | ||
|- | |- | ||
|buildEvent | |buildEvent | ||
|Builds SA2 event files | |Builds SA2 event files. | ||
|- | |- | ||
|buildMDL | |buildMDL | ||
|Builds SA2 MDL files | |Builds SA2 MDL files. | ||
|- | |- | ||
|buildMiniEvent | |buildMiniEvent | ||
|Builds SA2 in-level cutscenes | |Builds SA2 in-level cutscenes. | ||
|- | |- | ||
|buildMTN | |buildMTN | ||
|Builds SA2 MTN files | |Builds SA2 MTN files. | ||
|- | |- | ||
|BuildShapeMotion | |BuildShapeMotion | ||
|Creates Ninja Shape animations | |Creates Ninja Shape animations. | ||
|- | |- | ||
|ModelConverter | |ModelConverter | ||
|Converts .sa1mdl files to .sa2mdl and vice versa | |Converts .sa1mdl files to .sa2mdl and vice versa. | ||
|- | |- | ||
|ModelRelabeler | |ModelRelabeler | ||
|Copies [[labels]] from one model file to another | |Copies [[labels]] from one model file to another. | ||
|- | |- | ||
|PAKTool | |PAKTool | ||
|Extracts and builds .PAK archives | |Extracts and builds .PAK archives. | ||
This tool is superseded by ArchiveTool and is only provided for testing purposes. | |||
|- | |- | ||
|SETCodeGenerator | |SETCodeGenerator | ||
|Creates object loading code from a SET file and an object list | |Creates object loading code from a SET file and an object list. | ||
|- | |- | ||
|split | |split | ||
|Extracts data from [[Binary Files|binary files]] | |Extracts data from [[Binary Files|binary files]]. | ||
|- | |- | ||
|splitEvent | |splitEvent | ||
|Extracts data from SA2 event files | |Extracts data from SA2 event files. | ||
|- | |- | ||
|splitMiniEvent | |splitMiniEvent | ||
|Extracts data from SA2 in-level cutscenes | |Extracts data from SA2 in-level cutscenes. | ||
|- | |- | ||
|splitMTN | |splitMTN | ||
|Extracts data from SA2 MTN files | |Extracts data from SA2 MTN files. | ||
|- | |- | ||
|splitShapeMotion | |splitShapeMotion | ||
|Extracts data from Ninja Shape animations | |Extracts data from Ninja Shape animations. | ||
|- | |- | ||
|TextureRemap | |TextureRemap | ||
|Remaps texture IDs in a model file | |Remaps texture IDs in a model file. | ||
|- | |||
|TextureTool | |||
|Encodes and decodes texture files in all formats supported by SA Tools. | |||
|- | |- | ||
|WeldConverter | |WeldConverter | ||
|Converts a model's vertex welds to a custom weight format | |Converts a model's vertex welds to a custom weight format. | ||
|} | |} | ||
== Adding the PATH | == Adding the PATH Environment Variable == | ||
To make using command line tools easier, add the <code>bin</code> folder to your system <code>PATH</code> environment variable. | To make using command line tools easier, add the <code>bin</code> folder to your system <code>PATH</code> environment variable. | ||
Go to System Properties, Advanced and Click "Environment Variables...". You will see the following window: | Go to System Properties, Advanced and Click "Environment Variables...". You will see the following window: | ||
[[File:107878433-fd52f200-6f15-11eb-9f5b-e90d351286ab.png|none|thumb|Environment Variables window]] | |||
[[File:107878433-fd52f200-6f15-11eb-9f5b-e90d351286ab.png]] | |||
Select <code>Path</code> in in User Variables and click "Edit...". Then click New and type the location of your SA Tools' <code>bin</code> folder. Example: | Select <code>Path</code> in in User Variables and click "Edit...". Then click New and type the location of your SA Tools' <code>bin</code> folder. Example: | ||
[[File:107878513-8b2edd00-6f16-11eb-89bf-7fe910793324.png|none|thumb|Adding an environment variable]] | |||
[[File:107878513-8b2edd00-6f16-11eb-89bf-7fe910793324.png]] | |||
You can now run the tools from any folder in the command prompt. | You can now run the tools from any folder in the command prompt. | ||
== Examples and | == Examples and Usage == | ||
One way to launch the command prompt in the folder you need is opening the folder in Explorer and typing <code>cmd</code> in the address bar: | One way to launch the command prompt in the folder you need is opening the folder in Explorer and typing <code>cmd</code> in the address bar: | ||
| Line 97: | Line 99: | ||
[[File:107878816-69cef080-6f18-11eb-8832-b8d721c2f966.png|frameless|600x600px]] | [[File:107878816-69cef080-6f18-11eb-8832-b8d721c2f966.png|frameless|600x600px]] | ||
{{SAToolsNavbox}} | |||
Latest revision as of 05:44, 12 January 2026
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.
This tool is superseded by ArchiveTool and is only provided for testing purposes. |
| 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. |
| TextureTool | Encodes and decodes texture files in all formats supported by SA Tools. |
| 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).
| General Tools | SALVL • SAMDL • SAFontEdit • Texture Editor • Data Toolbox • SA Tools Hub |
|---|---|
| Sonic Adventure (DX) Tools | SADXTweaker2 • SADXSndSharp • SASave • PL Tool • VMS Editor |
| Sonic Adventure 2 (Battle) Tools | SA2 Event Viewer • SA2 Cutscene Text Editor • SA2 Message File Editor • SA2 Stage Select Editor • SA2 Cutscene Effect Editor • SA2 Light/Fog Editor |
| Other | Command Line Tools • Working with Binary Files |