Skip to content

Generating FBX

Buckminsterfullerene02 edited this page Aug 5, 2023 · 14 revisions

For asset types requiring .fbx files, CAS has two parts:

  1. Reads the cooked asset and converts it into a .fbx file [DEPRECIATED]
  2. Reads the cooked asset and the generated .fbx file to create the serialized JSON

The asset generator will then use the model hash from the JSON to import the FBX file.

The following asset types need .fbx files to be generated first to work:

  • Static Mesh
  • Skeletal Mesh
  • Animation Sequence

Note: Currently, no assets are converted directly from .uasset -> .fbx by my FBX-Wrapper tool. Although code for skeletons and skeletal meshes is there, the skeletons are messed up, at the time of writing. There is also a nicer pipeline to obtain static meshes, so I have disabled direct conversion of those too. If you wish to re-enable it, you can do so by uncommenting this line.


Generating FBX files

To obtain static meshes, skeletal meshes and animation sequences, you will need to follow through a couple of steps:

Run the CUE4Parse mass ActorX exporter

  1. Clone this CUE4Parse fork with git clone https://github.com/Buckminsterfullerene02/CUE4Parse.git --recursive
  2. Then switch to the mass-export branch with git checkout mass-export
  3. Go into AnimExport/Program.cs and change the settings constants at the top of the program above the Main function
  4. Run the exporter. As it may fail on a small number of files (such as additives with missing ref pose), my recommendation is to rerun the program a second time with _printSuccess = false and _replaceFiles = false so that your console only has the errors of the missing files in it. You can then decide what to do with those error messages, such as making an issue in the fork, or generating those missing assets using UModel (assuming they are not animation additives). The exporter will output a text file with a list of all the animation additives as there is no other easy way to tell.

Run the mass Blender ActorX -> FBX exporter

In Blender (I use 3.2 but 3.4 works fine too), put the following two scripts into %AppData%\Roaming\Blender Foundation\Blender\3.2\scripts\addons:

  1. ActorX -> FBX Blender Addon
  2. Mass export ActorX -> FBX that uses the script above

Now open Blender, go to edit -> preferences -> addons, and enable the Import: ActorX to FBX for Unreal and Import-Export: Import Unreal Skeleton Mesh (.psk)/Animation Set (.psa) (280) addons.

Before you do the next steps, navigate to Window -> Toggle system console. This will help give you an indicator of what it's currently doing, as the main blender window will completely freeze when running the mass export.

Then in the tool shelf, you should see PSK2FBX tab, and do the following:

  1. select file type "PSK" in the first section and the folder "SKMs" in the C# script's output dir. Run that
  2. select file type "PSKX" in the first section and the folder "SMs" and run that
  3. select file type "USE FOLDER" in the second section, the Sekeleton folder "SKs/Blender" and the PSA folder "AnimMonts" and run that. Then "AnimComps", then "AnimSeqs", and this final one will take longest to run

So overall, you should need to click the export buttons once for each asset type, with some waiting in-between!

Run CAS to generate JSON

Now you can copy all of your FBX files to the CAS Result Dir location so that when you run it, it will detect the presence of the FBX file and generate a model hash for that FBX file for your import.

Clone this wiki locally