AssetTools.EnablePublicAssetFeature
AssetTools.EnablePublicAssetFeature
#Overview
name: AssetTools.EnablePublicAssetFeature
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables the Experimental Public Asset Feature (False: disabled, True:enabled
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AssetTools.EnablePublicAssetFeature is to enable or disable the experimental Public Asset Feature in Unreal Engine 5. This feature is related to asset management and visibility within the engine.
This setting variable is primarily used by the AssetTools module and the Content Browser in Unreal Engine. It affects various aspects of asset handling, including renaming, context menus, and asset visibility.
The value of this variable is set through a console variable (CVar) defined in AssetTools.cpp. It’s initialized as false by default, meaning the feature is disabled unless explicitly enabled.
Several other variables and functions interact with this setting:
- bEnablePublicAssetFeature in AssetTools.cpp
- EnablePublicAssetFeatureCVar in multiple files
- bIsPublicAssetUIEnabled in some UI-related code
Developers must be aware that this is an experimental feature, as indicated by the comment in the code. Enabling it may affect asset visibility, renaming processes, and UI elements in the Content Browser.
Best practices when using this variable include:
- Only enable it if you specifically need the Public Asset Feature.
- Be cautious when enabling it in production environments, as it’s marked as experimental.
- Test thoroughly after enabling to ensure it doesn’t negatively impact your project’s asset management.
- Be aware that enabling this feature may change the behavior of asset renaming, visibility filters, and context menus in the Content Browser.
- Consider the implications on your project’s workflow before enabling or disabling this feature, especially if you’re working in a team environment.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp:451
Scope (from outer to inner):
file
namespace UE::AssetTools::Private
Source code excerpt:
static bool bEnablePublicAssetFeature = false;
static FAutoConsoleVariableRef CVarEnablePublicAssetFeature(
TEXT("AssetTools.EnablePublicAssetFeature"),
bEnablePublicAssetFeature,
TEXT("Enables the Experimental Public Asset Feature (False: disabled, True:enabled")
);
/**
* CVar to specify if we should use Header patching in advanced copy.
#Loc: <Workspace>/Engine/Source/Developer/AssetTools/Private/AssetRenameManager.cpp:1241
Scope (from outer to inner):
file
function void FAssetRenameManager::SetupPublicAssets
Source code excerpt:
void FAssetRenameManager::SetupPublicAssets(TArray<FAssetRenameDataWithReferencers>& AssetsToRename) const
{
static const IConsoleVariable* EnablePublicAssetFeatureCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("AssetTools.EnablePublicAssetFeature"));
if (!EnablePublicAssetFeatureCVar || !EnablePublicAssetFeatureCVar->GetBool())
{
return;
}
FScopedSlowTask SlowTask((float)AssetsToRename.Num(), LOCTEXT("SetupPublicAssets", "Setting up public assets..."));
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/AssetContextMenu.cpp:427
Scope (from outer to inner):
file
function void FAssetContextMenu::AddMenuOptions
Source code excerpt:
AddExploreMenuOptions(InMenu);
static const IConsoleVariable* EnablePublicAssetFeatureCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("AssetTools.EnablePublicAssetFeature"));
if (EnablePublicAssetFeatureCVar && EnablePublicAssetFeatureCVar->GetBool())
{
AddPublicStateMenuOptions(InMenu);
}
// Add reference options
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/AssetViewWidgets.cpp:909
Scope (from outer to inner):
file
function TSharedRef<SWidget> SAssetViewItem::CreateToolTipWidget
Source code excerpt:
TSharedRef<SVerticalBox> OverallTooltipVBox = SNew(SVerticalBox);
static const IConsoleVariable* EnablePublicAssetFeatureCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("AssetTools.EnablePublicAssetFeature"));
const bool bIsPublicAssetUIEnabled = EnablePublicAssetFeatureCVar && EnablePublicAssetFeatureCVar->GetBool();
// Top section (asset name, type, is checked out)
OverallTooltipVBox->AddSlot()
.AutoHeight()
.Padding(0, 0, 0, 4)
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/PathContextMenu.cpp:232
Scope (from outer to inner):
file
function void FPathContextMenu::MakePathViewContextMenu
Source code excerpt:
}
static const IConsoleVariable* EnablePublicAssetFeatureCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("AssetTools.EnablePublicAssetFeature"));
const bool bIsPublicAssetUIEnabled = EnablePublicAssetFeatureCVar && EnablePublicAssetFeatureCVar->GetBool();
FStringView SelectedFolderPathView(SelectedFolderPath);
if (bIsPublicAssetUIEnabled && FContentBrowserSingleton::Get().IsFolderShowPrivateContentToggleable(SelectedFolderPathView))
{
if (FContentBrowserSingleton::Get().IsShowingPrivateContent(SelectedFolderPathView))
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SContentBrowser.cpp:3996
Scope (from outer to inner):
file
function bool SContentBrowser::HandlePrivateContentFilter
Source code excerpt:
bool SContentBrowser::HandlePrivateContentFilter(const FContentBrowserItem& AssetItem)
{
static const IConsoleVariable* EnablePublicAssetFeatureCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("AssetTools.EnablePublicAssetFeature"));
if (!EnablePublicAssetFeatureCVar || !EnablePublicAssetFeatureCVar->GetBool())
{
return false;
}
FAssetData ItemAssetData;