Using the command-line tool
The asset baker is a command-line tool used to bake and deploy PopcornFX assets into a runtime-friendly layout. It allows you to specify a source project, and various platforms / output directories.
It is available by command-line, invoked through batch files, but it is also integrated in the PopcornFX editor
Depending on your licensing option, you can also get the AssetBakerLib, so you can link it in your projects, and invoke it directly from your own deployment toolchain if necessary.
Command-line options
|
Prints the PK-AssetBaker build version and exits. |
|
|
|
Specifies the bake target to bake for, with its output path. |
|
[v2.4.1] Forces baking in the output directory specified by the lowercase |
|
Bakes the asset without including its dependencies. |
|
Same as |
|
Prints the asset’s dependencies. |
|
Path to the global bake config file to use. |
|
Enables silent mode: Baker does not print any output |
|
Enables single-threaded baking (multithreaded by default since v2.3.0) |
|
Force full rebuild of all assets. |
|
Stops baking the entire asset list whenever an asset fails. |
|
Specifies the axis-system to bake the assets into. Available values are:
Where |
|
Logging severity level.
|
|
Prints the help screen and exits. |
Example .bat usage
Assuming we have the following directory layout:
(The editor authors effects directly in "H:\popcorn-packs\Editor\Packs\", and we have a single pack named "Game1_Spells"

And the following "BakePacks.bat":
@echo off echo Launching Popcorn-Fx asset ovens... PK-AssetBaker.exe -p="Packs\Game1_Spells" -o=x32:"..\builds\Game1Resources_x32\Particles\Spells" -o=x64:"..\builds\Game1Resources_x64\Particles\Spells" -I="Particles/*.pkfx" pause
Let’s dissect that command-line:
-
-p="Packs\Game1_Spells"
gives the source-pack path (one per invocation of asset-baker) -
-o=x32:"..\builds\Game1Resources_x32\Particles\Spells"
asks to bake an "x32" configuration into directory "..\builds\Game1Resources_x32\Particles\Spells" -
-o=x64:"..\builds\Game1Resources_x64\Particles\Spells"
asks to bake an "x64" configuration into directory "..\builds\Game1Resources_x64\Particles\Spells" -
-I="Particles/.pkfx"*
asks to bake all resource files that match "%SOURCE_PACK%/Particles/*.pkfx" (case-insensitive), including their dependencies
Running the batch file:

After running the batch file, the asset-baker will have produced the following output structure:

You can of course chain any number of calls to the asset baker in your batch file, to bake multiple packs at once:
@echo off echo Launching Popcorn-Fx asset ovens... PK-AssetBaker.exe -p="Packs\Game1_Spells" -o=x32:"..\builds\Game1Resources_x32\Particles\Spells" -o=x64:"..\builds\Game1Resources_x64\Particles\Spells" -I="Particles/*.pkfx" PK-AssetBaker.exe -p="Packs\Game1_Atmospheric" -o=x32:"..\builds\Game1Resources_x32\Particles\Atmospheric" -o=x64:"..\builds\Game1Resources_x64\Particles\Atmospheric" -I="Particles/*.pkfx" PK-AssetBaker.exe -p="Packs\Game1_WildLife" -o=x32:"..\builds\Game1Resources_x32\Particles\WildLife" -o=x64:"..\builds\Game1Resources_x64\Particles\WildLife" -I="Particles/*.pkfx" pause