AssetTools.EnablePublicAssetFeature

AssetTools.EnablePublicAssetFeature

#Overview

name: AssetTools.EnablePublicAssetFeature

This variable is created as a Console Variable (cvar).

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:

  1. bEnablePublicAssetFeature in AssetTools.cpp
  2. EnablePublicAssetFeatureCVar in multiple files
  3. 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:

  1. Only enable it if you specifically need the Public Asset Feature.
  2. Be cautious when enabling it in production environments, as it’s marked as experimental.
  3. Test thoroughly after enabling to ensure it doesn’t negatively impact your project’s asset management.
  4. Be aware that enabling this feature may change the behavior of asset renaming, visibility filters, and context menus in the Content Browser.
  5. 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;