bShowOnlySelectedActors

bShowOnlySelectedActors

#Overview

name: bShowOnlySelectedActors

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 16 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bShowOnlySelectedActors is to control the visibility of actors in the Unreal Engine editor’s scene outliner or data layer view. When enabled, it filters the displayed actors to show only those that are currently selected in the editor.

This setting variable is primarily used by the Scene Outliner and Data Layer Editor subsystems within Unreal Engine’s editor. It’s particularly relevant in the Object Mixer plugin and the Data Layer Editor module.

The value of this variable is typically set through user interactions in the editor UI. It can be toggled on or off via a checkbox or similar control in the scene outliner or data layer view.

This variable interacts with other filtering and display settings, such as bHideDataLayerActors, bHideUnloadedActors, and bHighlightSelectedDataLayers. These settings work together to determine what is displayed in the editor views.

Developers should be aware that enabling this option can significantly change the visibility of actors in the editor, which may affect their workflow. It’s particularly useful for focusing on specific actors in a complex scene but may hide important context if left enabled unintentionally.

Best practices when using this variable include:

  1. Use it temporarily to focus on specific actors, but remember to disable it when you need to see the full context of the scene.
  2. Be mindful of its state when working collaboratively, as it may affect what other team members see in the editor.
  3. Consider using it in conjunction with other filtering options for more precise control over the editor view.
  4. Remember to check this setting if actors seem to be missing from the outliner unexpectedly.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:123, section: [/Script/SceneOutliner.ActorBrowsingModeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Source/ObjectMixer/Private/Views/List/Modes/ObjectMixerOutlinerMode.cpp:248

Scope (from outer to inner):

file
function     FObjectMixerOutlinerMode::FObjectMixerOutlinerMode

Source code excerpt:

		LOCTEXT("ToggleShowOnlySelected", "Only Selected"),
		LOCTEXT("ToggleShowOnlySelectedToolTip", "When enabled, only displays actors that are currently selected."),
		LocalSettings.bShowOnlySelectedActors,
		FCreateSceneOutlinerFilter::CreateStatic(&FObjectMixerOutlinerMode::CreateShowOnlySelectedActorsFilter)
	);
	ShowOnlySelectedActorsInfo.OnToggle().AddLambda([this](bool bIsActive)
		{
			FObjectMixerOutlinerModeConfig* Settings = GetMutableConfig();
			if(Settings)
			{
				Settings->bShowOnlySelectedActors = bIsActive;
				SaveConfig();
			}
		});
	FilterInfoMap.Add(TEXT("ShowOnlySelectedActors"), ShowOnlySelectedActorsInfo);

	FSceneOutlinerFilterInfo HideTemporaryActorsInfo(

#Loc: <Workspace>/Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Source/ObjectMixer/Public/Views/List/Modes/ObjectMixerOutlinerMode.h:79

Scope: file

Source code excerpt:

	/** True when the Scene Outliner is only displaying selected Actors */
	UPROPERTY()
	bool bShowOnlySelectedActors = false;

	/** True when the Scene Outliner is not displaying Actor Components*/
	UPROPERTY()
	bool bHideActorComponents = true;

	/** True when the Scene Outliner is not displaying LevelInstances */

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerHierarchy.cpp:46

Scope (from outer to inner):

file
function     FDataLayerHierarchy::FDataLayerHierarchy

Source code excerpt:

	, bShowDataLayerActors(true)
	, bShowUnloadedActors(true)
	, bShowOnlySelectedActors(false)
	, bHighlightSelectedDataLayers(false)
	, bShowLevelInstanceContent(false)
{
	if (GEngine)
	{
		GEngine->OnLevelActorAdded().AddRaw(this, &FDataLayerHierarchy::OnLevelActorAdded);

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerHierarchy.cpp:126

Scope (from outer to inner):

file
function     bool FDataLayerHierarchy::IsDataLayerPartOfSelection

Source code excerpt:

bool FDataLayerHierarchy::IsDataLayerPartOfSelection(const UDataLayerInstance* DataLayerInstance) const
{
	if (!bShowOnlySelectedActors)
	{
		return true;
	}

	if (UDataLayerEditorSubsystem::Get()->DoesDataLayerContainSelectedActors(DataLayerInstance))
	{

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerHierarchy.h:34

Scope (from outer to inner):

file
class        class FDataLayerHierarchy : public ISceneOutlinerHierarchy
function     void SetShowOnlySelectedActors

Source code excerpt:

	void SetShowDataLayerActors(bool bInShowDataLayerActors) { bShowDataLayerActors = bInShowDataLayerActors; }
	void SetShowUnloadedActors(bool bInShowUnloadedActors) { bShowUnloadedActors = bInShowUnloadedActors; }
	void SetShowOnlySelectedActors(bool bInbShowOnlySelectedActors) { bShowOnlySelectedActors = bInbShowOnlySelectedActors; }
	void SetHighlightSelectedDataLayers(bool bInHighlightSelectedDataLayers) { bHighlightSelectedDataLayers = bInHighlightSelectedDataLayers; }
	void SetShowLevelInstanceContent(bool bInShowLevelInstanceContent) { bShowLevelInstanceContent = bInShowLevelInstanceContent; }
	bool GetShowLevelInstanceContent() const { return bShowLevelInstanceContent; }
private:
	UWorld* GetOwningWorld() const;
	FDataLayerHierarchy(FDataLayerMode* Mode, const TWeakObjectPtr<UWorld>& Worlds);

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerHierarchy.h:69

Scope (from outer to inner):

file
class        class FDataLayerHierarchy : public ISceneOutlinerHierarchy

Source code excerpt:

	bool bShowDataLayerActors;
	bool bShowUnloadedActors;
	bool bShowOnlySelectedActors;
	bool bHighlightSelectedDataLayers;
	bool bShowLevelInstanceContent;
};

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.cpp:141

Scope (from outer to inner):

file
function     FDataLayerMode::FDataLayerMode

Source code excerpt:

	bHideDataLayerActors = SharedSettings->bHideDataLayerActors;
	bHideUnloadedActors = SharedSettings->bHideUnloadedActors;
	bShowOnlySelectedActors = SharedSettings->bShowOnlySelectedActors;
	bHighlightSelectedDataLayers = SharedSettings->bHighlightSelectedDataLayers;
	bHideLevelInstanceContent = SharedSettings->bHideLevelInstanceContent;

	FSceneOutlinerFilterInfo ShowOnlySelectedActorsInfo(LOCTEXT("ToggleShowOnlySelected", "Only Selected"), LOCTEXT("ToggleShowOnlySelectedToolTip", "When enabled, only displays actors that are currently selected."), bShowOnlySelectedActors, FCreateSceneOutlinerFilter::CreateStatic(&FDataLayerMode::CreateShowOnlySelectedActorsFilter));
	ShowOnlySelectedActorsInfo.OnToggle().AddLambda([this](bool bIsActive)
	{
		UWorldPartitionEditorPerProjectUserSettings* Settings = GetMutableDefault<UWorldPartitionEditorPerProjectUserSettings>();
		Settings->bShowOnlySelectedActors = bShowOnlySelectedActors = bIsActive;
		Settings->PostEditChange();

		if (auto DataLayerHierarchy = StaticCast<FDataLayerHierarchy*>(Hierarchy.Get()))
		{
			DataLayerHierarchy->SetShowOnlySelectedActors(bIsActive);
		}

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.cpp:2066

Scope (from outer to inner):

file
function     TUniquePtr<ISceneOutlinerHierarchy> FDataLayerMode::CreateHierarchy

Source code excerpt:

	DataLayerHierarchy->SetShowDataLayerActors(!bHideDataLayerActors);
	DataLayerHierarchy->SetShowUnloadedActors(!bHideUnloadedActors);
	DataLayerHierarchy->SetShowOnlySelectedActors(bShowOnlySelectedActors);
	DataLayerHierarchy->SetHighlightSelectedDataLayers(bHighlightSelectedDataLayers);
	DataLayerHierarchy->SetShowLevelInstanceContent(!bHideLevelInstanceContent);
	return DataLayerHierarchy;
}

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.cpp:2190

Scope (from outer to inner):

file
function     bool FDataLayerMode::ShouldExpandDataLayer

Source code excerpt:

bool FDataLayerMode::ShouldExpandDataLayer(const UDataLayerInstance* DataLayer) const
{
	if (bHighlightSelectedDataLayers || bShowOnlySelectedActors)
	{
		if (DataLayer)
		{
			if ((bShowOnlySelectedActors && DataLayerEditorSubsystem->DoesDataLayerContainSelectedActors(DataLayer)) ||
				(ContainsSelectedChildDataLayer(DataLayer) && !DataLayer->GetChildren().IsEmpty()))
			{
				return true;
			}
		}
	}

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.cpp:2234

Scope (from outer to inner):

file
function     void FDataLayerMode::SynchronizeSelection

Source code excerpt:

void FDataLayerMode::SynchronizeSelection()
{
	if (!bShowOnlySelectedActors && !bHighlightSelectedDataLayers)
	{
		return;
	}

	TArray<AActor*> Actors;
	TSet<const UDataLayerInstance*> ActorDataLayersIncludingParents;

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.cpp:2268

Scope (from outer to inner):

file
function     void FDataLayerMode::OnLevelSelectionChanged

Source code excerpt:

void FDataLayerMode::OnLevelSelectionChanged(UObject* Obj)
{
	if (!bShowOnlySelectedActors && !bHighlightSelectedDataLayers)
	{
		return;
	}

	RefreshSelection();
}

#Loc: <Workspace>/Engine/Source/Editor/DataLayerEditor/Private/DataLayer/DataLayerMode.h:124

Scope (from outer to inner):

file
class        class FDataLayerMode : public ISceneOutlinerMode

Source code excerpt:

	bool bHideUnloadedActors;
	/** Should show only selected actors */
	bool bShowOnlySelectedActors;
	/** Should highlight DataLayers containing selected actors */
	bool bHighlightSelectedDataLayers;
	/** Should level instance actors content be hidden */
	bool bHideLevelInstanceContent;

	/** Delegate to call when an item is picked */

#Loc: <Workspace>/Engine/Source/Editor/SceneOutliner/Private/ActorBrowsingMode.cpp:107

Scope (from outer to inner):

file
function     FActorBrowsingMode::FActorBrowsingMode

Source code excerpt:


	// Get the OutlinerModule to register FilterInfos with the FilterInfoMap
	FSceneOutlinerFilterInfo ShowOnlySelectedActorsInfo(LOCTEXT("ToggleShowOnlySelected", "Only Selected"), LOCTEXT("ToggleShowOnlySelectedToolTip", "When enabled, only displays actors that are currently selected."), LocalSettings.bShowOnlySelectedActors, FCreateSceneOutlinerFilter::CreateStatic(&FActorBrowsingMode::CreateShowOnlySelectedActorsFilter));
	ShowOnlySelectedActorsInfo.OnToggle().AddLambda([this](bool bIsActive)
		{
			FActorBrowsingModeConfig* Settings = GetMutableConfig();
			if(Settings)
			{
				Settings->bShowOnlySelectedActors = bIsActive;
				SaveConfig();
			}
		});
	FilterInfoMap.Add(TEXT("ShowOnlySelectedActors"), ShowOnlySelectedActorsInfo);
		
	FSceneOutlinerFilterInfo OnlyCurrentLevelInfo(LOCTEXT("ToggleShowOnlyCurrentLevel", "Only in Current Level"), LOCTEXT("ToggleShowOnlyCurrentLevelToolTip", "When enabled, only shows Actors that are in the Current Level."), LocalSettings.bShowOnlyActorsInCurrentLevel, FCreateSceneOutlinerFilter::CreateStatic(&FActorBrowsingMode::CreateIsInCurrentLevelFilter));

#Loc: <Workspace>/Engine/Source/Editor/SceneOutliner/Private/ActorBrowsingModeSettings.h:47

Scope: file

Source code excerpt:

	/** True when the Scene Outliner is only displaying selected Actors */
	UPROPERTY()
	bool bShowOnlySelectedActors = false;

	/** True when the Scene Outliner is not displaying Actor Components*/
	UPROPERTY()
	bool bHideActorComponents = true;

	/** True when the Scene Outliner is not displaying LevelInstances */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/WorldPartition/WorldPartitionEditorPerProjectUserSettings.h:57

Scope (from outer to inner):

file
class        class UWorldPartitionEditorPerProjectUserSettings : public UDeveloperSettings
function     UWorldPartitionEditorPerProjectUserSettings

Source code excerpt:

		, bHideDataLayerActors(true)
		, bHideUnloadedActors(false)
		, bShowOnlySelectedActors(false)
		, bHighlightSelectedDataLayers(true)
		, bHideLevelInstanceContent(true)
		, bDisableLoadingOfLastLoadedRegions(false)
		, MinimapUnloadedOpacity(0.66f)
#endif
	{}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/WorldPartition/WorldPartitionEditorPerProjectUserSettings.h:154

Scope (from outer to inner):

file
class        class UWorldPartitionEditorPerProjectUserSettings : public UDeveloperSettings

Source code excerpt:

	/** True when the Data Layer Outliner is only displaying actors and datalayers for selected actors */
	UPROPERTY(config, EditAnywhere, Category = "Data Layer")
	uint32 bShowOnlySelectedActors : 1;

	/** True when the Data Layer Outliner highlights Data Layers containing actors that are currently selected */
	UPROPERTY(config, EditAnywhere, Category = "Data Layer")
	uint32 bHighlightSelectedDataLayers : 1;

	/** True when the Data Layer Outliner is not displaying Level Instance content */