Description

Right now the AssetManager uses different logic in ModifyCook vs VerifyCanCook, specifically related to secondary assets like textures or maps that are indirectly loaded by soft object paths and are also managed by a PrimaryAssetLabel or other primary asset. VerifyCanCook checks the cook rule for the management hierarchy for every cooked asset, but ModifyCook only does this for assets that are either a Primary Asset themselves or are a secondary asset inside a bundle of a primary asset that does NOT have it's own asset package.

The ModifyCook logic is incorrect for secondary assets that exist in bundles of primary assets like labels that have a real asset package. The correct fix is probably to change ModifyCook to run the GetAssetBundleEntries logic even if GetPrimaryAssetData succeeds. It would then pass in the excluded assets to the PackagesToNeverCook list as users expect.

 

Steps to Reproduce
  1. Open a project like L.yra in the editor and Package it for windows to ensure that cooking works
  2. Add a new PrimaryAssetLabel (miscellaneous->DataAsset, pick that as the class) asset to the root of your Content path named something like NoCookAssets
  3. In the label, set the Cook Rule to NeverCook and add an Explicit Asset reference by hitting +
  4. Point the explicit asset to /Engine/EngineMaterials/DefaultBloomKernel, which is an optional asset many games will want to exclude from cooking. Save the label
  5. Package the project again, note that it fails to apply the cook rule and will fail the cook with an error:

LogAssetManager: Error: Package /Engine/EngineMaterials/DefaultBloomKernel is set to NeverCook, but something is trying to cook it! Instigators: { StartupSoftObjectPath }

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-142198 in the post.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core - Cooker
Affects Versions4.275.0
Target Fix5.1
Fix Commit18955800
Main Commit18955800
CreatedFeb 10, 2022
ResolvedFeb 14, 2022
UpdatedJun 30, 2022