Jump to content

Command Line Tools: Difference between revisions

From SA Docs
Created page with "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>. The <code>bin</code> folder contains a readme file with a brief overview of all command line tools. == 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. Go to S..."
 
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
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>. The <code>bin</code> folder contains a readme file with a brief overview of all command line tools.
== Introduction ==
In addition to GUI tools like [[Texture Editor]] and [[SAMDL]], [[SA Tools]] include several command line tools useful for scripting and other purposes.


== Adding the PATH environment variable ==
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>).


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:
== List of Tools ==
{| class="wikitable"
!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|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 ==


![https://user-images.githubusercontent.com/23312549/107878433-fd52f200-6f15-11eb-9f5b-e90d351286ab.png Environment Variables]
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:
[[File:107878433-fd52f200-6f15-11eb-9f5b-e90d351286ab.png|none|thumb]]


Select <code>Path</code> in in User Variables and click "Edit...". The 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]]
 
![https://user-images.githubusercontent.com/23312549/107878513-8b2edd00-6f16-11eb-89bf-7fe910793324.png Add New Environment Variable]
 


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 Usage ==
 
== 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:


[[File:107878688-b960ec80-6f17-11eb-984f-3391717597bc.png|frameless|600x600px]]


![https://user-images.githubusercontent.com/23312549/107878688-b960ec80-6f17-11eb-984f-3391717597bc.png Typing CMD]
Hit Enter and you can now use the command line tools in this folder:
Hit Enter and you can now use the command line tools in this folder:


 
[[File:107878729-eca37b80-6f17-11eb-9ff4-4f1356a096af.png|frameless|600x600px]]
![https://user-images.githubusercontent.com/23312549/107878729-eca37b80-6f17-11eb-9ff4-4f1356a096af.png Command Prompt]


To learn how to use a specific tool, run it without command line arguments.
To learn how to use a specific tool, run it without command line arguments.
![https://user-images.githubusercontent.com/23312549/107878787-368c6180-6f18-11eb-87df-40be3f53b01c.png ObjScan example]


[[File:107878787-368c6180-6f18-11eb-87df-40be3f53b01c.png|frameless|600x600px]]


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


<code>objscan SA1 STG01.PRS C900000 all</code>


<code>objscan SA1 STG01.PRS C900000 all</code>
Note: the file <code>STG01.PRS</code> must exist in the folder you're running the command in (<code>D:\test</code> in this example).


Note: the file STG01.PRS must exist in the folder you're running the command in (<code>D:\test</code> in this example).
[[File:107878816-69cef080-6f18-11eb-8832-b8d721c2f966.png|frameless|600x600px]]


![https://user-images.githubusercontent.com/23312549/107878816-69cef080-6f18-11eb-8832-b8d721c2f966.png ObjScan example 2]
{{SAToolsNavbox}}

Latest revision as of 23:32, 29 October 2025

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