DisplayEmptyFolders
DisplayEmptyFolders
#Overview
name: DisplayEmptyFolders
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 9
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DisplayEmptyFolders is to control whether empty folders are shown in the Content Browser of Unreal Engine 5’s editor interface. This setting is primarily used for organizing and displaying content within the editor.
DisplayEmptyFolders is primarily used by the Content Browser module of Unreal Engine 5. It affects the behavior of various components within this module, including SAssetView, SContentBrowser, and SPathView.
The value of this variable is set in the UContentBrowserSettings class, which is a configuration class for the Content Browser. It can be accessed and modified through the engine’s settings system.
This variable interacts with other Content Browser settings, such as DisplayFolders, DisplayDevelopersFolder, and DisplayEngineFolder. It’s also used in conjunction with the FContentBrowserInstanceConfig, which can override the default setting for specific instances of the Content Browser.
Developers should be aware that changing this setting can affect the visibility of folders in the Content Browser. When set to true, empty folders will be displayed, which can help maintain a clear folder structure but may clutter the view. When set to false, empty folders are hidden, which can make the Content Browser appear cleaner but may hide important structural information.
Best practices when using this variable include:
- Consider the project’s organization needs when deciding whether to show or hide empty folders.
- Be consistent in its usage across the project to maintain a uniform experience for all team members.
- Use it in conjunction with other Content Browser settings to create an optimal viewing experience.
- Be aware that changing this setting may affect how other team members perceive the project structure, so communicate any changes clearly.
- When creating custom Content Browser-like interfaces, respect this setting to maintain consistency with the engine’s default behavior.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorSettings.ini:27, section: [/Script/UnrealEd.ContentBrowserSettings]
- INI Section:
/Script/UnrealEd.ContentBrowserSettings
- 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/Editor/ContentBrowser/Private/SAssetView.cpp:3010
Scope (from outer to inner):
file
function void SAssetView::ToggleShowEmptyFolders
Source code excerpt:
check(IsToggleShowEmptyFoldersAllowed());
bool bNewState = !GetDefault<UContentBrowserSettings>()->DisplayEmptyFolders;
if (FContentBrowserInstanceConfig* Config = GetContentBrowserConfig())
{
bNewState = !Config->bShowEmptyFolders;
Config->bShowEmptyFolders = bNewState;
UContentBrowserConfig::Get()->SaveEditorConfig();
}
GetMutableDefault<UContentBrowserSettings>()->DisplayEmptyFolders = !GetDefault<UContentBrowserSettings>()->DisplayEmptyFolders;
GetMutableDefault<UContentBrowserSettings>()->PostEditChange();
}
bool SAssetView::IsToggleShowEmptyFoldersAllowed() const
{
return bCanShowFolders;
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp:3040
Scope (from outer to inner):
file
function bool SAssetView::IsShowingEmptyFolders
Source code excerpt:
}
return GetDefault<UContentBrowserSettings>()->DisplayEmptyFolders;
}
void SAssetView::ToggleRealTimeThumbnails()
{
check(CanShowRealTimeThumbnails());
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SAssetView.cpp:4551
Scope (from outer to inner):
file
function void SAssetView::HandleSettingChanged
Source code excerpt:
{
if ((PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, DisplayFolders)) ||
(PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, DisplayEmptyFolders)) ||
(PropertyName == "DisplayDevelopersFolder") ||
(PropertyName == "DisplayEngineFolder") ||
(PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, bDisplayContentFolderSuffix)) ||
(PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, bDisplayFriendlyNameForPluginFolders)) ||
(PropertyName == NAME_None)) // @todo: Needed if PostEditChange was called manually, for now
{
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SContentBrowser.cpp:197
Scope (from outer to inner):
file
namespace ContentBrowser
function TArray<FContentBrowserItem> GetChildItemsFromVirtualPath
Source code excerpt:
{
const UContentBrowserSettings* ContentBrowserSettings = GetDefault<UContentBrowserSettings>();
bool bDisplayEmpty = ContentBrowserSettings->DisplayEmptyFolders;
// check to see if we have an instance config that overrides the default in UContentBrowserSettings
if (const FContentBrowserInstanceConfig* EditorConfig = GetConstInstanceConfig(ConfigInstanceName))
{
bDisplayEmpty = EditorConfig->bShowEmptyFolders;
}
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SContentBrowser.cpp:4483
Scope (from outer to inner):
file
function FContentBrowserInstanceConfig* SContentBrowser::CreateEditorConfigIfRequired
Source code excerpt:
InstanceConfig->bShowPluginContent = Settings->GetDisplayPluginFolders();
InstanceConfig->bShowFolders = Settings->DisplayFolders;
InstanceConfig->bShowEmptyFolders = Settings->DisplayEmptyFolders;
InstanceConfig->bShowCppFolders = Settings->GetDisplayCppFolders();
InstanceConfig->bCollectionsDocked = Settings->GetDockCollections();
InstanceConfig->bFavoritesExpanded = Settings->GetDisplayFavorites();
InstanceConfig->bSearchAssetPaths = Settings->GetIncludeAssetPaths();
InstanceConfig->bSearchClasses = Settings->GetIncludeClassNames();
InstanceConfig->bSearchCollections = Settings->GetIncludeCollectionNames();
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SPathView.cpp:1533
Scope (from outer to inner):
file
function void SPathView::Populate
Source code excerpt:
{
const UContentBrowserSettings* ContentBrowserSettings = GetDefault<UContentBrowserSettings>();
bool bDisplayEmpty = ContentBrowserSettings->DisplayEmptyFolders;
// check to see if we have an instance config that overrides the default in UContentBrowserSettings
if (FContentBrowserInstanceConfig* EditorConfig = GetContentBrowserConfig())
{
bDisplayEmpty = EditorConfig->bShowEmptyFolders;
}
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SPathView.cpp:1978
Scope (from outer to inner):
file
function void SPathView::HandleItemDataUpdated
Source code excerpt:
const UContentBrowserSettings* ContentBrowserSettings = GetDefault<UContentBrowserSettings>();
bool bDisplayEmpty = ContentBrowserSettings->DisplayEmptyFolders;
// check to see if we have an instance config that overrides the default in UContentBrowserSettings
if (FContentBrowserInstanceConfig* EditorConfig = GetContentBrowserConfig())
{
bDisplayEmpty = EditorConfig->bShowEmptyFolders;
}
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SPathView.cpp:2111
Scope (from outer to inner):
file
function void SPathView::HandleSettingChanged
Source code excerpt:
void SPathView::HandleSettingChanged(FName PropertyName)
{
if ((PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, DisplayEmptyFolders)) ||
(PropertyName == "DisplayDevelopersFolder") ||
(PropertyName == "DisplayEngineFolder") ||
(PropertyName == "DisplayPluginFolders") ||
(PropertyName == "DisplayL10NFolder") ||
(PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, bDisplayContentFolderSuffix)) ||
(PropertyName == GET_MEMBER_NAME_CHECKED(UContentBrowserSettings, bDisplayFriendlyNameForPluginFolders)) ||
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/ContentBrowserSettings.h:35
Scope (from outer to inner):
file
class class UContentBrowserSettings : public UObject
Source code excerpt:
/** Whether to empty display folders in the asset view of the content browser. */
UPROPERTY(config)
bool DisplayEmptyFolders;
/** Whether to filter recursively when a filter is applied in the asset view of the content browser. */
UPROPERTY(config)
bool FilterRecursively = true;
/** Whether to group root folders under a common folder in the path view */