set_primary_asset_cook_rule
Set the CookRule for a primary asset type in Unreal Engine's Asset Manager to control asset cooking. Writes changes to DefaultGame.ini.
Instructions
Set the CookRule of an existing PrimaryAssetTypesToScan rule in the Asset Manager project settings, plus ChunkId and bApplyRecursively when given, then write DefaultGame.ini (no undo); a failed write makes success false. An unknown type (add it with add_primary_asset_rule) or cook_rule is an error before any change. Priority is not touched here; add_primary_asset_rule sets it. Nothing is rescanned. Read the rules back with get_primary_asset_cook_rules; the reply's cook_rule is the short name of the stored rule.
Returns: { primary_asset_type, cook_rule, priority, chunk_id, apply_recursively, saved }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chunk_id | No | Optional chunk ID override for the rule | |
| cook_rule | Yes | One of "Unknown" / "Never" / "Development" / "DevelopmentAlways" / "Always", case-insensitive; "Development" stores ProductionNeverCook, and the EPrimaryAssetCookRule names (e.g. "AlwaysCook", "DevelopmentAlwaysProductionUnknownCook") are accepted too. | |
| apply_recursively | No | Optional flag to apply the rule recursively | |
| primary_asset_type | Yes | Name of the primary asset type (e.g. "Item"). |