bShouldWarnAboutInvalidAssets
bShouldWarnAboutInvalidAssets
#Overview
name: bShouldWarnAboutInvalidAssets
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bShouldWarnAboutInvalidAssets is to control whether the Asset Manager system in Unreal Engine 5 should issue warnings about invalid assets. This setting is part of the Asset Management system, which is responsible for handling and organizing game assets.
The Unreal Engine subsystem that relies on this setting variable is the Asset Manager, which is part of the Engine module. This can be seen from the file paths and class names in the provided code references.
The value of this variable is set in the UAssetManagerSettings class, which is derived from UDeveloperSettings. It is initialized to true in the constructor of UAssetManagerSettings and can be modified through the project settings in the Unreal Editor.
This variable interacts with the Asset Manager’s warning system, particularly in the WarnAboutInvalidPrimaryAsset function. When set to true, it allows the Asset Manager to log warnings about invalid primary assets.
Developers must be aware that:
- This setting affects the verbosity of the Asset Manager’s warning system.
- Disabling this warning might hide important issues related to asset management.
- It’s part of the config system, meaning it can be adjusted in the project settings without code changes.
Best practices when using this variable include:
- Keep it enabled during development to catch potential asset-related issues early.
- Consider disabling it for shipping builds if you’re confident in your asset management.
- Use it in conjunction with other Asset Manager settings to fine-tune the system’s behavior.
- Review and address any warnings that appear when this setting is enabled to ensure the integrity of your asset system.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:56, section: [/Script/Engine.AssetManagerSettings]
- INI Section:
/Script/Engine.AssetManagerSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/AssetManagerSettings.h:73
Scope (from outer to inner):
file
class class UAssetManagerSettings : public UDeveloperSettings
function UAssetManagerSettings
Source code excerpt:
, bShouldGuessTypeAndNameInEditor(true)
, bShouldAcquireMissingChunksOnLoad(false)
, bShouldWarnAboutInvalidAssets(true)
{}
/** List of asset types to scan at startup */
UPROPERTY(config, EditAnywhere, Category = "Asset Manager", meta = (TitleProperty = "PrimaryAssetType"))
TArray<FPrimaryAssetTypeInfo> PrimaryAssetTypesToScan;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/AssetManagerSettings.h:116
Scope (from outer to inner):
file
class class UAssetManagerSettings : public UDeveloperSettings
Source code excerpt:
/** If true, the asset manager will warn when it is told to load or do something with assets it does not know about */
UPROPERTY(config, EditAnywhere, Category = "Asset Manager")
bool bShouldWarnAboutInvalidAssets;
/** Redirect from Type:Name to Type:NameNew */
UPROPERTY(config, EditAnywhere, Category = "Redirects")
TArray<FAssetManagerRedirect> PrimaryAssetIdRedirects;
/** Redirect from Type to TypeNew */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AssetManager.cpp:3729
Scope (from outer to inner):
file
function void UAssetManager::WarnAboutInvalidPrimaryAsset
Source code excerpt:
const UAssetManagerSettings& Settings = GetSettings();
if (Settings.bShouldWarnAboutInvalidAssets)
{
const TSharedRef<FPrimaryAssetTypeData>* FoundType = AssetTypeMap.Find(PrimaryAssetId.PrimaryAssetType);
if (FoundType)
{
UE_LOG(LogAssetManager, Warning, TEXT("Invalid Primary Asset Id %s: %s"), *PrimaryAssetId.ToString(), *Message);