SLevelViewport

Encapsulates an [SViewport](API\Runtime\Slate\Widgets\SViewport) and an SLevelViewportToolBar

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

LevelEditor

Header

/Engine/Source/Editor/LevelEditor/Public/SLevelViewport.h

Include

#include "SLevelViewport.h"

Syntax

class SLevelViewport :
    public SEditorViewport,
    public IAssetViewport

Remarks

Encapsulates an SViewport and an SLevelViewportToolBar

Constructors

Name Description

Public function

SLevelViewport()

Destructors

Name Description

Public function

~SLevelViewport()

Functions

Name Description

Public function Static

bool

 

CanGetCameraInformationFromActor

(
    AActor* Actor
)

Public function Const

bool

 

CanToggleGameView()

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Constructs the viewport widget

Public function

void

 

ConstructLevelEditorViewportClient

(
    const FArguments& InArgs
)

Constructs the level editor viewport client

Public function

void

 

ConstructViewportOverlayContent()

Constructs the widgets for the viewport overlay

Public function Const

TSharedRef< ...

 

CreateActorLockSceneOutlinerColumn

(
    ISceneOutliner& SceneOutliner
)

Public function Const

TSharedRef< ...

 

GenerateLevelMenu()

Public function Static

float

 

GetActorLockSceneOutlinerColumnWidth()

Public function Static

bool

 

GetCameraInformationFromActor

(
    AActor* Actor,
    FMinimalViewInfo& out_CameraInfo
)

Public function Const

EVisibility

 

GetCloseImmersiveButtonVisibility()

Called to get the visibility of the viewport's 'Restore from Immersive' button.

Public function Const

const TShare...

 

GetCommandList()

Public function Const

FName

 

GetConfigKey()

Returns the config key associated with this viewport.

Public function Virtual Const

EVisibility

 

GetCurrentLevelButtonVisibility()

Public function Const

FText

 

GetCurrentLevelText

(
    bool bDrawOnlyLabel
)

Called to get the level text

Public function Virtual Const

EVisibility

 

GetCurrentLevelTextVisibility()

Public function Const

FText

 

GetCurrentScreenPercentageText

(
    bool bDrawOnlyLabel
)

Called to get the screen percentage preview text

Public function Const

EVisibility

 

GetCurrentScreenPercentageVisibility()

Public function Const

FString

 

GetDeviceProfileString()

Public function Const

EVisibility

 

GetFullToolbarVisibility()

Get the visibility for items considered to be part of the 'full' viewport toolbar

Public function Const

const FLevel...

 

GetLevelViewportClient()

Public function

FLevelEditor...

 

GetLevelViewportClient()

Public function Const

EVisibility

 

GetMaximizeToggleVisibility()

Called to get the visibility of the viewport's maximize/minimize toggle button.

Public function Const

TWeakPtr< IL...

 

GetParentLevelEditor()

Get the parent level editor for this viewport

Public function Const

FText

 

GetSelectedActorsCurrentLevelText

(
    bool bDrawOnlyLabel
)

Called to get the text for the level the currently selected actor or actors are in.

Public function Virtual Const

EVisibility

 

GetSelectedActorsCurrentLevelTextVisibility()

Public function Const

EVisibility

 

GetToolbarVisibility()

Get the visibility for viewport toolbar

Public function Virtual Const

EVisibility

 

GetToolBarVisibility()

Called to get the visibility of the level viewport toolbar

Public function Virtual Const

EVisibility

 

GetViewportControlsVisibility()

Public function Const

FName

 

GetViewportTypeWithinLayout()

Get this level viewport widget's type within its parent layout

Public function Const

bool

 

IsActorAlwaysPreview

(
    TWeakObjectPtr< AActor > Actor
)

For the specified actor, See if we're forcing a preview

Public function Const

bool

 

IsActorLocked

(
    const TWeakObjectPtr< AActor > Acto...
)

Public function

bool

 

IsActorPreviewDetached

(
    TWeakObjectPtr< AActor > PreviewAct...
)

See if the specified actor's ActorPreview is detached from actor

Public function

bool

 

IsActorPreviewPinned

(
    TWeakObjectPtr< AActor > PreviewAct...
)

See if the specified actor's ActorPreview is pinned or not

Public function Const

bool

 

IsAnyActorLocked()

Public function Const

bool

 

IsDeviceProfileStringSet

(
    FString ProfileName
)

Public function Const

bool

 

IsFoliageTypeVisible

(
    TWeakObjectPtr< class UFoliageType ...
)

Checks if a foliage type is visible in this viewport

Public function Const

bool

 

IsInForegroundTab()

Public function Const

bool

 

IsLayerVisible

(
    FName LayerName
)

Checks if a layer is visible in this viewport

Called to determine if a layer is visible.

Public function Const

bool

 

IsLockedCameraViewEnabled()

Check whether locked camera view is enabled

Public function Const

bool

 

IsMaximized()

Public function Const

bool

 

IsPlayInEditorViewportActive()

Public function Const

bool

 

IsSelectedActorLocked()

Public function Const

bool

 

IsViewportConfigurationSet

(
    FName ConfigurationName
)

Returns whether the named layout is currently selected on the parent tab that this viewport belongs to.

Public function

bool

 

IsViewportTypeWithinLayoutEqual

(
    FName InLayoutType
)

Checks if the specified layout type matches our current viewport type.

Protected function

void

 

LockActorInternal

(
    AActor* NewActorToLock
)

Public function

void

 

OnActorLockToggleFromMenu

(
    AActor* Actor
)

Called to lock/unlock the actor from the viewport's context menu

Public function

void

 

OnActorSelectionChanged

(
    const TArray< UObject* >& New...,
    bool bForceRefresh
)

Called on all viewports, when actor selection changes.

Public function

void

 

OnClearAllBookmarks()

Called to clear all bookmarks

Public function

void

 

OnClearBookmark

(
    int32 BookmarkIndex
)

Called to clear a bookmark

Public function

void

 

OnCompactBookmarks()

Called to Compact Bookmarks.

Public function

void

 

OnFloatingButtonClicked()

Actions to perform whenever the viewports floating buttons are pressed

Public function

void

 

OnJumpToBookmark

(
    int32 BookmarkIndex
)

Called to jump to a bookmark

Public function

FReply

 

OnMenuClicked()

Public function

void

 

OnPreviewSelectedCamerasChange()

Called when Preview Selected Cameras preference is changed.

Public function

void

 

OnSetBookmark

(
    int32 BookmarkIndex
)

Called to set a bookmark

Public function

void

 

OnSetViewportConfiguration

(
    FName ConfigurationName
)

Sets the current layout on the parent tab that this viewport belongs to.

Public function

FReply

 

OnToggleMaximize()

Called when the maximize command is executed

Public function

void

 

RemoveAllPreviews

(
    const bool bRemoveFromDesktopViewpo...
)

Unpin and close all actor preview windows

Public function Const

void

 

SaveConfig

(
    const FString& ConfigName
)

Saves this viewport's config to ULevelEditorViewportSettings

Public function

void

 

SetActorAlwaysPreview

(
    TWeakObjectPtr< AActor > PreviewAct...,
    bool bAlwaysPreview
)

For the specified actor, toggle Pinned/Unpinned of it's ActorPreview

Public function

void

 

SetDeviceProfileString

(
    const FString& ProfileName
)

Set the device profile name

Public function

void

 

SetKeyboardFocusToThisViewport()

Sets Slate keyboard focus to this viewport

Public function

void

 

SetViewportTypeWithinLayout

(
    FName InLayoutType
)

Set this level viewport widget's type within its parent layout

Public function

void

 

ToggleActorPilotCameraView()

Toggles enabling the exact camera view when locking a viewport to a camera

Public function

void

 

ToggleActorPreviewIsPanelDetached

(
    TWeakObjectPtr< AActor > PreviewAct...
)

For the specified actor, toggle whether the panel is detached from it

Public function

void

 

ToggleActorPreviewIsPinned

(
    TWeakObjectPtr< AActor > PreviewAct...
)

For the specified actor, toggle Pinned/Unpinned of it's ActorPreview

Public function

void

 

ToggleAllFoliageTypes

(
    bool bVisible
)

Toggles all foliage types visibility

Public function

void

 

ToggleShowFoliageType

(
    TWeakObjectPtr< class UFoliageType ...
)

Toggles foliage type visibility in this viewport

Public function

void

 

ToggleShowLayer

(
    FName LayerName
)

Toggles layer visibility in this viewport

Public function

void

 

ToggleViewportTypeActivationWithinLayout

(
    FName InLayoutType
)

Activates the specified viewport type in the layout, if it's not already, or reverts to default if it is.

Overridden from SEditorViewport

Name Description

Protected function Virtual

void

 

BindCommands()

Public function Virtual Const

EVisibility

 

GetTransformToolbarVisibility()

Controls the visibility of the widget transform toolbar, if there is an associated toolbar

Public function Virtual Const

UWorld *

 

GetWorld()

Gets the world this viewport is for

Public function Virtual Const

bool

 

IsVisible()

Protected function Virtual

TSharedRef< ...

 

MakeEditorViewportClient()

SEditorViewport interface

Protected function Virtual

TSharedPtr< ...

 

MakeViewportToolbar()

Implement this to add a viewport toolbar to the inside top of the viewport.

Protected function Virtual

void

 

OnDecrementPositionGridSize()

Protected function Virtual

void

 

OnDecrementRotationGridSize()

Public function Virtual

void

 

OnFocusViewportToSelection()

SEditorViewport Interface

Protected function Virtual Const

const FSlate...

 

OnGetViewportBorderBrush()

Protected function Virtual Const

FSlateColor

 

OnGetViewportBorderColorAndOpacity()

Protected function Virtual Const

EVisibility

 

OnGetViewportContentVisibility()

This is not the visibility of the scene rendered in the viewport

Protected function Virtual

void

 

OnIncrementPositionGridSize()

Changes the snapping grid size

Protected function Virtual

void

 

OnIncrementRotationGridSize()

Overridden from IAssetViewport

Name Description

Public function Virtual

void

 

AddOverlayWidget

(
    TSharedRef< SWidget > OverlaidWidge...
)

Adds a widget overlaid over the viewport

Public function Virtual Const

TSharedRef< ...

 

AsWidget()

Returns the SLevelViewport widget (const).

Public function Virtual

TSharedRef< ...

 

AsWidget()

Returns the SLevelViewport widget.

Public function Virtual

void

 

EndPlayInEditorSession()

Ends a currently active play in editor session in this viewport

Public function Virtual

FViewport &#...

 

GetActiveViewport()

Gets the active viewport.

Public function Virtual

FEditorViewp...

 

GetAssetViewportClient()

Public function Virtual Const

TSharedPtr< ...

 

GetSharedActiveViewport()

Public function Virtual

TWeakPtr< SV...

 

GetViewportWidget()

Returns the SViewport widget contained within the SLevelViewport.

Public function Virtual Const

bool

 

HasPlayInEditorViewport()

Public function Virtual Const

bool

 

IsImmersive()

Public function Virtual Const

bool

 

IsInGameView()

Public function Virtual

void

 

MakeImmersive

(
    const bool bWantImmersive,
    const bool bAllowAnimation
)

Attempts to switch this viewport into immersive mode

Public function Virtual

void

 

OnSimulateSessionFinished()

Called by the editor when simulate mode with this viewport finishes

Public function Virtual

void

 

OnSimulateSessionStarted()

Called by the editor when simulate mode is started with this viewport

Public function Virtual

void

 

RegisterGameViewportIfPIE()

Registers a game viewport with the Slate application so that specific messages can be routed directly to this level viewport if it is an active PIE viewport

Public function Virtual

void

 

RemoveOverlayWidget

(
    TSharedRef< SWidget > OverlaidWidge...
)

Removes a widget that was previously overlaid on to this viewport

Public function Virtual

void

 

StartPlayInEditorSession

(
    UGameViewportClient* PlayClien...,
    const bool bInSimulateInEditor
)

IAssetViewport Interface

Public function Virtual

void

 

SwapViewportsForPlayInEditor()

Swaps the active SIE viewport client with the inactive PIE viewport (Swaps back to the game) It is not valid to call this unless we have an active simulate in editor session

Public function Virtual

void

 

SwapViewportsForSimulateInEditor()

Swaps the active PIE viewport client with the level editor viewport client for simulate in editor It is not valid to call this unless we have an active play in editor session

Public function Virtual

void

 

ToggleGameView()

Called when game view should be toggled

Classes

Name

Description

Public struct

FArguments

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss