bIsCompactMode

bIsCompactMode

#Overview

name: bIsCompactMode

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

#Summary

#Usage in the C++ source code

The purpose of bIsCompactMode is to control the display mode of various UI elements in Unreal Engine 5, particularly in visualization and debugging tools. It is used to toggle between a normal view and a more condensed, space-efficient view.

This setting variable is primarily used in the following Unreal Engine subsystems and plugins:

  1. GameplayInsights plugin
  2. AssetManagerEditor plugin
  3. PluginReferenceViewer plugin
  4. RenderGraphInsights plugin
  5. SlateInsights plugin
  6. TraceInsights module

The value of this variable is typically set through user interaction with the UI. For example, in the PluginReferenceViewer, it’s toggled via the OnCompactModeChanged() function.

bIsCompactMode interacts with other variables that control UI layout and rendering, such as EventH, EventDY, TimelineDY, and MinTimelineH. These variables are adjusted based on whether compact mode is enabled or disabled.

Developers should be aware that enabling compact mode may hide certain UI elements or reduce the level of detail shown. For instance, in the PluginReferenceViewer, compact mode affects node size and layout.

Best practices when using this variable include:

  1. Ensuring that all relevant UI elements gracefully adapt to the change in display mode.
  2. Providing a clear way for users to toggle between normal and compact modes.
  3. Persisting the user’s preference for compact mode across sessions where appropriate.
  4. Considering performance implications when switching between modes, especially for large or complex visualizations.
  5. Testing the UI thoroughly in both normal and compact modes to ensure all necessary information remains accessible and legible.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:983, section: [/Script/AssetManagerEditor.ReferenceViewerSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/GameplayInsights/Source/GameplayInsights/Private/GameplayGraphTrack.cpp:166

Scope (from outer to inner):

file
function     void FGameplayGraphTrack::Draw

Source code excerpt:


	const FTimingTrackViewport& Viewport = Context.GetViewport();
	if(IsAnyOptionEnabled(ShowLabelsOption) && !Viewport.GetLayout().bIsCompactMode)
	{
		FDrawContext& DrawContext = Context.GetDrawContext();
		const ITimingViewDrawHelper& DrawHelper = Context.GetHelper();

		int32 ActiveSeriesIndex = 0;
		for (const TSharedPtr<FGraphSeries>& Series : AllSeries)

#Loc: <Workspace>/Engine/Plugins/Editor/AssetManagerEditor/Source/AssetManagerEditor/Private/ReferenceViewer/ReferenceViewerSettings.cpp:31

Scope (from outer to inner):

file
function     bool UReferenceViewerSettings::IsCompactMode

Source code excerpt:

bool UReferenceViewerSettings::IsCompactMode() const
{
	return bIsCompactMode;
}

bool UReferenceViewerSettings::IsShowExternalReferencers() const
{
	return bIsShowExternalReferencers;
}

#Loc: <Workspace>/Engine/Plugins/Editor/AssetManagerEditor/Source/AssetManagerEditor/Private/ReferenceViewer/ReferenceViewerSettings.cpp:106

Scope (from outer to inner):

file
function     void UReferenceViewerSettings::SetCompactModeEnabled

Source code excerpt:

void UReferenceViewerSettings::SetCompactModeEnabled(bool bNewEnabled)
{
	bIsCompactMode = bNewEnabled;
	SaveConfig();
}

void UReferenceViewerSettings::SetShowExternalReferencersEnabled(bool bEnabled)
{
	bIsShowExternalReferencers = bEnabled;

#Loc: <Workspace>/Engine/Plugins/Editor/AssetManagerEditor/Source/AssetManagerEditor/Public/ReferenceViewer/ReferenceViewerSettings.h:181

Scope (from outer to inner):

file
class        class UReferenceViewerSettings : public UObject

Source code excerpt:

	/* Whether to show the nodes in a compact (no thumbnail) view */
	UPROPERTY(config)
	bool bIsCompactMode;

	/* Whether to show external referencers or collapsed owner asset */
	UPROPERTY(config)
	bool bIsShowExternalReferencers;

	/* Whether to show the package's path as a comment */

#Loc: <Workspace>/Engine/Plugins/Experimental/PluginReferenceViewer/Source/PluginReferenceViewer/Private/EdGraph_PluginReferenceViewer.cpp:340

Scope (from outer to inner):

file
function     UEdGraphNode_PluginReference* UEdGraph_PluginReferenceViewer::RecursivelyCreateNodes

Source code excerpt:

	else
	{
		const bool bIsCompactMode = PluginReferenceViewer.Pin()->IsCompactModeChecked();
		const bool bIsADuplicate = NodeInfo.Parents.Num() > 1;

		NewNode = CreatePluginReferenceNode();
		NewNode->SetupPluginReferenceNode(InNodeLoc, NodeInfo.Identifier, NodeInfo.Plugin, !bIsCompactMode, bIsADuplicate);
		NodeProvSize = NodeInfo.ProvisionSize(InParentId);
	}

	const bool bIsCompactMode = PluginReferenceViewer.Pin()->IsCompactModeChecked();
	const bool bShowDuplicates = PluginReferenceViewer.Pin()->IsShowDuplicatesChecked();

	bool bIsFirstOccurance = bIsRoot || NodeInfo.IsFirstParent(InParentId);
	FIntPoint ChildLoc = InNodeLoc;
	if (!UE::PluginReferenceViewer::Private::ExceedsMaxSearchDepth(InCurrentDepth, InMaxDepth) && bIsFirstOccurance) // Only expand the first parent
	{
		// position the children nodes
		const int32 ColumnWidth = bIsCompactMode ? 500 : 800;
		ChildLoc.X += bInReferencers ? -ColumnWidth : ColumnWidth;

		int32 NodeSizeY = bIsCompactMode ? 100 : 200;
		ChildLoc.Y -= (NodeProvSize - 1) * NodeSizeY * 0.5;

		int32 Breadth = 0;
		int32 ChildIdx = 0;
		for (; ChildIdx < InNodeInfos[InPluginId].Children.Num(); ChildIdx++)
		{

#Loc: <Workspace>/Engine/Plugins/Experimental/PluginReferenceViewer/Source/PluginReferenceViewer/Private/EdGraph_PluginReferenceViewer.cpp:496

Scope (from outer to inner):

file
function     UEdGraphNode_PluginReference* UEdGraph_PluginReferenceViewer::RefilterGraph

Source code excerpt:

		const TSharedPtr<const SPluginReferenceViewer> LocalPluginReferenceViewer = PluginReferenceViewer.Pin();

		const bool bIsCompactMode = LocalPluginReferenceViewer->IsCompactModeChecked();
		const int32 SettingsReferencerMaxDepth = LocalPluginReferenceViewer->GetSearchReferencerDepthCount();
		const int32 SettingsDependencyMaxDepth = LocalPluginReferenceViewer->GetSearchDependencyDepthCount();

		FPluginIdentifier FirstGraphRootIdentifier = CurrentGraphRootIdentifiers[0];

		const FPluginReferenceNodeInfo& NodeInfo = ReferencerNodeInfos[FirstGraphRootIdentifier];
		RootNode = CreatePluginReferenceNode();
		RootNode->SetupPluginReferenceNode(CurrentGraphRootOrigin, NodeInfo.Identifier, NodeInfo.Plugin, !bIsCompactMode, false);

		// Show referencers
		RecursivelyFilterNodeInfos(FirstGraphRootIdentifier, ReferencerNodeInfos, 0, SettingsReferencerMaxDepth);
		RecursivelyCreateNodes(true, FirstGraphRootIdentifier, CurrentGraphRootOrigin, FirstGraphRootIdentifier, RootNode, ReferencerNodeInfos, 0, SettingsReferencerMaxDepth, /*bIsRoot*/ true);

		// Show dependencies

#Loc: <Workspace>/Engine/Plugins/Experimental/PluginReferenceViewer/Source/PluginReferenceViewer/Private/SPluginReferenceViewer.cpp:513

Scope (from outer to inner):

file
function     bool SPluginReferenceViewer::IsCompactModeChecked

Source code excerpt:

bool SPluginReferenceViewer::IsCompactModeChecked() const
{
	return Settings.bIsCompactMode;
}

void SPluginReferenceViewer::OnCompactModeChanged()
{
	Settings.bIsCompactMode = !Settings.bIsCompactMode;
	GraphObj->RefilterGraph();
}

void SPluginReferenceViewer::OnShowDuplicatesChanged()
{
	Settings.bShowDuplicates = !Settings.bShowDuplicates;

#Loc: <Workspace>/Engine/Plugins/Experimental/PluginReferenceViewer/Source/PluginReferenceViewer/Private/SPluginReferenceViewer.h:106

Scope (from outer to inner):

file
class        class SPluginReferenceViewer : public SCompoundWidget

Source code excerpt:

		int32 MaxSearchReferencersDepth = 1;
		int32 MaxSearchDependencyDepth = 1;
		bool bIsCompactMode = false;
		bool bShowDuplicates = true;
		bool bShowEnginePlugins = true;
		bool bShowOptionalPlugins = true;
	};

	void OnTabSpawned(const FName& TabIdentifier, const TSharedRef<SDockTab>& SpawnedTab);

#Loc: <Workspace>/Engine/Plugins/RenderGraphInsights/Source/RenderGraphInsights/Private/RenderGraphTrack.cpp:969

Scope (from outer to inner):

file
namespace    UE
namespace    RenderGraphInsights
function     void FRenderGraphTrack::Draw

Source code excerpt:

					DrawHelper.DrawBox(*this, LineStartX, Depth, LineWidth, SinglePixelDepth, LineColor, EDrawLayer::Background);

					Offset += TransientBytesPerDepthSlot * (Layout.bIsCompactMode ? 3 : 1);
					OffsetIndex++;
				}
			}
		}
	}
}

#Loc: <Workspace>/Engine/Plugins/Slate/SlateInsights/Source/SlateInsights/Private/SlateFrameGraphTrack.cpp:185

Scope (from outer to inner):

file
namespace    UE
namespace    SlateInsights
function     void FSlateFrameGraphTrack::Draw

Source code excerpt:

	const bool bShowLabel = IsAnyOptionEnabled(Private::ShowLabelsOption)
		&& Layout == ESlateFrameGraphLayout::Stack
		&& !Viewport.GetLayout().bIsCompactMode;
	if (bShowLabel)
	{
		int32 ActiveSeriesIndex = 0;
		for (const TSharedPtr<FGraphSeries>& Series : AllSeries)
		{
			Private::FSlateFrameGraphSeries& SlateGraphSeries = *StaticCastSharedPtr<Private::FSlateFrameGraphSeries>(Series);

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Private/Insights/ViewModels/TimingViewLayout.cpp:6

Scope (from outer to inner):

file
function     void FTimingViewLayout::ForceNormalMode

Source code excerpt:

void FTimingViewLayout::ForceNormalMode()
{
	bIsCompactMode = false;
	EventH = NormalLayoutEventH;
	EventDY = NormalLayoutEventDY;
	TimelineDY = NormalLayoutTimelineDY;
	ChildTimelineDY = NormalLayoutChildTimelineDY;
	MinTimelineH = NormalLayoutMinTimelineH;
	TargetMinTimelineH = NormalLayoutMinTimelineH;

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Private/Insights/ViewModels/TimingViewLayout.cpp:19

Scope (from outer to inner):

file
function     void FTimingViewLayout::ForceCompactMode

Source code excerpt:

void FTimingViewLayout::ForceCompactMode()
{
	bIsCompactMode = true;
	EventH = CompactLayoutEventH;
	EventDY = CompactLayoutEventDY;
	TimelineDY = CompactLayoutTimelineDY;
	ChildTimelineDY = CompactLayoutChildTimelineDY;
	MinTimelineH = CompactLayoutMinTimelineH;
	TargetMinTimelineH = CompactLayoutMinTimelineH;

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Private/Insights/ViewModels/TimingViewLayout.cpp:35

Scope (from outer to inner):

file
function     bool FTimingViewLayout::Update

Source code excerpt:

	bool bHasChanged = false;

	if (bIsCompactMode)
	{
		if (EventH > CompactLayoutEventH)
		{
			EventH -= LayoutTransitionSpeed;
			bHasChanged = true;
		}

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Public/Insights/ViewModels/TimingTrackViewport.h:210

Scope (from outer to inner):

file
class        class FTimingTrackViewport
function     bool IsLayoutCompactModeEnabled

Source code excerpt:

	void UpdateLayout();

	bool IsLayoutCompactModeEnabled() const { return Layout.bIsCompactMode; }

	void SwitchLayoutCompactMode()
	{
		Layout.bIsCompactMode = !Layout.bIsCompactMode;
		AddDirtyFlags(ETimingTrackViewportDirtyFlags::VLayoutChanged);
	}

	void ToggleLayoutMinTrackHeight()
	{
		if (Layout.TargetMinTimelineH == 0.0f)

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Public/Insights/ViewModels/TimingViewLayout.h:25

Scope: file

Source code excerpt:

	//////////////////////////////////////////////////

	bool bIsCompactMode;

	float EventH; // height of a timing event, in Slate units
	float EventDY; // vertical space between timing events in two adjacent lanes, in Slate units
	float TimelineDY; // space at top and bottom of each track (i.e. above first lane and below last lane), in Slate units
	float ChildTimelineDY; // space between a child track's lanes and the parent's lanes, in Slate units
	float MinTimelineH; // current minimum height of a track, in Slate units