Hi! I want to test cook an asset using C++ but I could not find any useful information about how to do it on the internet. Dose anyone know how to make it?
Cooking a single asset in C++ is essentially calling SavePackage with a specific cook context. To build this pipeline, you need to:
-
Call
BeginCacheForCookedPlatformDataon the asset for your target platform. -
Wait for all asynchronous shader compilations and UE5
AssetCompiletasks to finish. -
Call
SavePackageusing the correctPackageWriter, depending on whether your project uses traditionalPakfiles orIoStore.
If your end goal is just to quickly update specific assets in a live game and you’d rather not build and maintain all this boilerplate C++, I developed a plugin called Runtime Details that handles this exact low-level process.
With our Asset Hot Update feature, you can select specific assets, and the tool will automatically run this entire C++ cook pipeline, generate the Pak or IoStore file, and push it directly to your running Packaged Build over the network.