SCHG How-to

Convert HKX Animations

From Sonic Retro

SCHG:Sonic Unleashed (XBOX 360/PS3)
Main Article
Import Levels (360)

(Original guide by HaxHabte)

This is a guide on how to convert character HKX animations from Sonic Unleashed into the FBX format (XBOX 360 VERSION).

Required Tools

Extracting/Opening Unleashed ar.?? files (XBOX 360 ver.)

Extracting or opening ar files from Sonic Unleashed normally like you would in Sonic Generations with Generations Archive Editor will give you an error. This is because the files are compressed to conserve disk space. In order to be able to open Unleashed ar files, you will need to decompress them before attempting to open them with Generations Archive Editor. To do this use QuickBMS and the Xcompress script found on the QuickBMS homepage to decompress the files. Once done you'll be able to open the decompressed ar.?? files using Generations Archive Editor from which you can then extract/edit files.

Preparing HKX files for Conversion

Once you have determined which character/enemy you want to convert animations for, extract the ar.00 file contents into any folder (preferably a new folder). The folder should contain .HKX files which is the file format that contains the animation data for the model, a SKL.HKX file that contains the skeleton data for the model, as well as the actual .model and texture data. Next, you want to use the HKX Converter to convert the current .HKX files into new .HKX files that will be recognized by modelfbx. Open the HKX Converter folder and place all the .HKX files you want to convert into the "source" folder and click on "convert-source-folder-and-resave-meta" to begin. Once complete you'll see all the converted files in the "output" folder. These are the files that will be able to be converted by modelfbx into the FBX format. Place the new .HKX into the original extracted ar archive and replace the originals.

Convert into FBX

After you've done all that, open up the directory for modelfbx (mentioned at the beginning of the guide) and create a folder to move all the extracted ar + .HKX data into. Once done, navigate the folder until you see a .bat file named "modelfbx-convert-example" where all SonicGLVL related applications are and open it in notepad. You will see a line of code written in there that looks like this: for %%f in (Sonic/*.anm.hkx) do modelfbx Sonic/SonicRoot.model Sonic/SonicRoot.skl.hkx Sonic/%%f Sonic/%%f.fbx. Replace all instances of "Sonic/" in the code with the folder name where you moved the files you wanted to convert into (like "EggFighter/" as an example), replace "SonicRoot.model" with the name of the model file in the archive, and finally replace "SonicRoot.skl.hkx" with the .skl.hxk file associated with the .model file in the archive. Save the file, close notepad, and then run the .bat file. If done correctly you should see a DOS window open up and convert each .HKX file into .FBX. You will find the converted files inside the folder you created in the directory.