-
Notifications
You must be signed in to change notification settings - Fork 11
Generating FBX
For asset types requiring .fbx
files, CAS has two parts:
- Reads the cooked asset and converts it into a
.fbx
file [DEPRECIATED] - 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.
To obtain static meshes, skeletal meshes and animation sequences, you will need to follow through a couple of steps:
- Clone this CUE4Parse fork with
git clone https://github.com/Buckminsterfullerene02/CUE4Parse.git --recursive
- Then switch to the mass-export branch with
git checkout mass-export
- Go into
AnimExport/Program.cs
and change the settings constants at the top of the program above theMain
function - 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.
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
:
- ActorX -> FBX Blender Addon
- 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:
- select file type "PSK" in the first section and the folder "SKMs" in the C# script's output dir. Run that
- select file type "PSKX" in the first section and the folder "SMs" and run that
- 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!
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.