figment / hkxcmd

Havok Command Line Tools for Skyrim
Other
61 stars 23 forks source link
    Havok Command Line Tools 1.4
    ============================

This package includes a command line application for converting Havok models from Skyrim the native format to something that can be manipulated or used as a reference for non-derivative works.

Currently the package only converts from native HKX files built with Havok 2010.2.0 SDK to the XML form of HKX or to the Gamebryo KF file format.

Prerequisites:

Quick Start:

  1. Convert Packed HKX to XML HKX files

    • If you do not specify the output folder it will assume that it should write to the same folder and append "-out" the filename.
    • The XML HKX files can be loaded into Havok tools like the Havok Preview Tool

      hkxcmd convert "%TEMP%\Skyrim - Animations"

  2. Convert Packed HKX to XML HKX files and place in another folder

    • The following will convert all HKX files in the "%TEMP%\Skyrim - Animations" folder and subfolders and place them in the "%TEMP%\Skyrim - Animations - Output" folder.

      hkxcmd convert "%TEMP%\Skyrim - Animations" "%TEMP%\Skyrim - Animations - Output"

  3. Preview Animation in Havok Preview Tool

    • Load the Preview Tool: Start | Havok | Havok PcXs Content Tools 2010.2.0 | Havok Preview Tool

    • Convert Skeleton.hkx using step 1 or 2 above

    • File | Open... | Browse for converted skeleton

      • Assuming you used Tutorial 2 that would be the following for the chicken
        "%TEMP%\Skyrim - Animations - Output\meshes\actors\ambient\chicken\character assets\skeleton.hkx"
      • If you get a "Wrong platform for packfile" error when loading then you selected the original skeleton not the converted one.
    • File | Add... | Browse for an animation for that skeleton

      • Assuming you used Tutorial 2 that would be the following for the chicken "%TEMP%\Skyrim - Animations - Output\meshes\actors\ambient\chicken\animation\getup.hkx"
  4. Convert HKX file to Gamebryo KF files

    • The following will just dump KF files into same folder as the HKX file

      hkxcmd exportkf "%TEMP%\Skyrim - Animations"

  5. Convert HKX file to Gamebryo KF files into a different folder

    • The following will convert all HKX files in the "%TEMP%\Skyrim - Animations" folder and subfolders and place them in the "%TEMP%\Skyrim - Animations - Output" folder.

      hkxcmd exportkf "%TEMP%\Skyrim - Animations" "%TEMP%\Skyrim - Animations - Output"

  6. Import Skyrim Animation into 3ds Max

    • First import the creature into max using niftools max importer

      • Select Import | "Netimmerse/Gamebryo (.nif, .kf)" | Pick the file to import
      • Continuing the chicken theme I used the following
      • "%TEMP%\Skyrim - Meshes\meshes\actors\ambient\chicken\character assets\chicken.nif"
      • If you have problems with meshes try importing the skeleton explicitly before the mesh
      • Not all creatures use the name skeleton.nif so you might have to manually adjust path
    • Assuming this succeeded now import the animation

      • Select Import | "Netimmerse/Gamebryo (.nif, .kf)" | Pick the animation
      • Find an animation you which to import such as the getup animation
      • Assuming you used Tutorial 5 that would be the following for the chicken: "%TEMP%\Skyrim - Animations - Output\meshes\actors\ambient\chicken\animation\getup.kf"
  7. Export Skyrim Animation from 3ds Max in KF format

    • Select the root node (usually "NPC Root [Root]")
    • Open Graph Editors | Track View - Dope Sheet
    • Add a Note Track to the Root Node
    • Note that the KF generated by the exportkf process will now add start and end note tracks
    • Add a note at time 0 with text "start"
    • Add a note on the final frame of animation with text "end"
    • Select Export | "Netimmerse/Gamebryo (.nif, .kf)" | Specify an file name like "export.kf"
    • Select "Single KF w/o NIF" under Animation in the "Export Nif" dialog
    • Select "Export"
    • I usually load in Nifskope after this just to make sure its valid enough
  8. Convert KF format to HKX Format

    • The following will convert a KF file using the base skeleton for its bone layout and bind pose
    • By default it exports as a Win32 Packed Binary HKX file but you can change that from the command line to export as XML adding -v:XML

      hkxcmd convertkf "\path\to\skeleton.hkx" "\path\to\export.kf" "\path\to\export.hkx"

Troubleshooting:

Known Issues:

Change Log: 1.4

Source Code:

Acknowledgements: