SLevelViewport

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

Unreal Engine C++ API Reference > Editor > LevelEditor

Inheritance Hierarchy

References

   
Module LevelEditor
Header /Engine/Source/Editor/LevelEditor/Public/SLevelViewport.h
Include #include "SLevelViewport.h"

Syntax

class SLevelViewport :  
    public [SAssetEditorViewport](API\Editor\UnrealEd\SAssetEditorViewport),  
    public [IAssetViewport](API\Editor\UnrealEd\IAssetViewport)  

Remarks

Encapsulates an SViewport and an SLevelViewportToolBar

Constructors

Type Name Description
  SLevelViewport ()  

Destructors

Type Name Description
  ~SLevelViewport ()  

Functions

Type Name Description
bool CanGetCameraInformationFromActor ( AActor* Actor )  
bool CanToggleGameView ()  
void Construct ( const FArguments& InArgs, const FAssetEditorViewportConstruct... ) Constructs the viewport widget
void ConstructLevelEditorViewportClient ( FLevelEditorViewportInstanceSetting... ) Constructs the level editor viewport client
void ConstructViewportOverlayContent () Constructs the widgets for the viewport overlay
TSharedRef< ... CreateActorLockSceneOutlinerColumn ( ISceneOutliner& SceneOutliner )  
void EnableInViewportMenu ()  
float GetActorLockSceneOutlinerColumnWidth ()  
bool GetAllowsCinematicControl ()  
bool GetCameraInformationFromActor ( AActor* Actor, FMinimalViewInfo& out_CameraInfo )  
EVisibility GetCloseImmersiveButtonVisibility () Called to get the visibility of the viewport's 'Restore from Immersive' button.
const TShare... GetCommandList ()  
FName GetConfigKey () Returns the config key associated with this viewport.
FMargin GetContextMenuPadding ()  
FText GetCurrentScreenPercentageText () Called to get the screen percentage preview text
EVisibility GetCurrentScreenPercentageVisibility ()  
FString GetDeviceProfileString ()  
EVisibility GetFullToolbarVisibility () Get the visibility for items considered to be part of the 'full' viewport toolbar
const FLevel... GetLevelViewportClient ()  
FLevelEditor... GetLevelViewportClient ()  
EVisibility GetMaximizeToggleVisibility () Called to get the visibility of the viewport's maximize/minimize toggle button.
TWeakPtr< IL... GetParentLevelEditor () Get the parent level editor for this viewport
FText GetSelectedActorsCurrentLevelText ( bool bDrawOnlyLabel ) Called to get the text for the level the currently selected actor or actors are in.
EVisibility GetSelectedActorsCurrentLevelTextVisibility ()  
EVisibility GetToolbarVisibility () Get the visibility for viewport toolbar
EVisibility GetToolBarVisibility () Called to get the visibility of the level viewport toolbar
EVisibility GetViewportControlsVisibility ()  
bool IsActorAlwaysPreview ( TWeakObjectPtr< AActor > Actor ) For the specified actor, See if we're forcing a preview
bool IsActorEditorContextVisible ()  
bool IsActorLocked ( const TWeakObjectPtr< AActor > Acto... )  
bool IsActorPreviewDetached ( TWeakObjectPtr< AActor > PreviewAct... ) See if the specified actor's ActorPreview is detached from actor
bool IsActorPreviewPinned ( TWeakObjectPtr< AActor > PreviewAct... ) See if the specified actor's ActorPreview is pinned or not
bool IsAnyActorLocked ()  
bool IsDeviceProfileStringSet ( FString ProfileName )  
bool IsFoliageTypeVisible ( TWeakObjectPtr< class UFoliageType ... ) Checks if a foliage type is visible in this viewport
bool IsInForegroundTab ()  
bool IsLayerVisible ( FName LayerName ) Checks if a layer is visible in this viewportCalled to determine if a layer is visible.
bool IsLockedCameraViewEnabled () Check whether locked camera view is enabled
bool IsMaximized ()  
bool IsPlayInEditorViewportActive ()  
bool IsSelectedActorLocked ()  
void LockActorInternal ( AActor* NewActorToLock )  
void OnActorLockToggleFromMenu ( AActor* Actor ) Called to lock/unlock the actor from the viewport's context menu
void OnActorSelectionChanged ( const TArray< UObject* >& New..., bool bForceRefresh ) Called on all viewports, when actor selection changes.
void OnClearAllBookmarks () Called to clear all bookmarks
void OnClearBookmark ( int32 BookmarkIndex ) Called to clear a bookmark
void OnCompactBookmarks () Called to Compact Bookmarks.
void OnElementSelectionChanged ( const UTypedElementSelectionSet..., bool bForceRefresh ) Called on all viewports, when element selection changes.
void OnFloatingButtonClicked () Actions to perform whenever the viewports floating buttons are pressed
void OnJumpToBookmark ( int32 BookmarkIndex ) Called to jump to a bookmark
void OnPreviewSelectedCamerasChange () Called when Preview Selected Cameras preference is changed.
void OnSetBookmark ( int32 BookmarkIndex ) Called to set a bookmark
FReply OnToggleMaximize () Called when the maximize command is executed
void RemoveAllPreviews ( const bool bRemoveFromDesktopViewpo... ) Unpin and close all actor preview windows
void SaveConfig ( const FString& ConfigName ) Saves this viewport's config to ULevelEditorViewportSettings
void SetActorAlwaysPreview ( TWeakObjectPtr< AActor > PreviewAct..., bool bAlwaysPreview ) For the specified actor, toggle Pinned/Unpinned of it's ActorPreview
void SetAllowsCinematicControl ( bool bAllow ) Sets whether the viewport should allow cinematic control
void SetDeviceProfileString ( const FString& ProfileName ) Set the device profile name
void SetKeyboardFocusToThisViewport () Sets Slate keyboard focus to this viewport
void ToggleActorPilotCameraView () Toggles enabling the exact camera view when locking a viewport to a camera
void ToggleActorPreviewIsPanelDetached ( TWeakObjectPtr< AActor > PreviewAct... ) For the specified actor, toggle whether the panel is detached from it
void ToggleActorPreviewIsPinned ( TWeakObjectPtr< AActor > PreviewAct... ) For the specified actor, toggle Pinned/Unpinned of it's ActorPreview
void ToggleAllFoliageTypes ( bool bVisible ) Toggles all foliage types visibility
void ToggleShowFoliageType ( TWeakObjectPtr< class UFoliageType ... ) Toggles foliage type visibility in this viewport
void ToggleShowLayer ( FName LayerName ) Toggles layer visibility in this viewport

Overridden from SEditorViewport

Type Name Description
void BindCommands ()  
bool CanToggleInViewportContextMenu ()  
EVisibility GetTransformToolbarVisibility () Controls the visibility of the widget transform toolbar, if there is an associated toolbar
UWorld * GetWorld () Gets the world this viewport is for
void HideInViewportContextMenu ()  
bool IsVisible ()  
TSharedRef< ... MakeEditorViewportClient () SEditorViewport interface
TSharedPtr< ... MakeViewportToolbar () Implement this to add a viewport toolbar to the inside top of the viewport.
void OnDecrementPositionGridSize ()  
void OnDecrementRotationGridSize ()  
void OnFocusViewportToSelection () SEditorViewport Interface
EVisibility OnGetFocusedViewportIndicatorVisibility ()  
const FSlate... OnGetViewportBorderBrush ()  
FSlateColor OnGetViewportBorderColorAndOpacity ()  
EVisibility OnGetViewportContentVisibility ()  
void OnIncrementPositionGridSize () Changes the snapping grid size
void OnIncrementRotationGridSize ()  
void ToggleInViewportContextMenu () Called when the user wants to show the in-viewport context menu

Overridden from IAssetViewport

Type Name Description
void AddOverlayWidget ( TSharedRef< SWidget > OverlaidWidge... ) Adds a widget overlaid over the viewport
TSharedRef< ... AsWidget () Returns the SLevelViewport widget (const).
TSharedRef< ... AsWidget () Returns the SLevelViewport widget.
void EndPlayInEditorSession () Ends a currently active play in editor session in this viewport
FViewport &#... GetActiveViewport () Gets the active viewport.
FEditorViewp... GetAssetViewportClient ()  
TSharedPtr< ... GetSharedActiveViewport ()  
TWeakPtr< SV... GetViewportWidget () Returns the SViewport widget contained within the SLevelViewport.
bool HasPlayInEditorViewport ()  
bool IsImmersive ()  
bool IsInGameView ()  
void MakeImmersive ( const bool bWantImmersive, const bool bAllowAnimation ) Attempts to switch this viewport into immersive mode
void OnSimulateSessionFinished () Called by the editor when simulate mode with this viewport finishes
void OnSimulateSessionStarted () Called by the editor when simulate mode is started with this viewport
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
void RemoveOverlayWidget ( TSharedRef< SWidget > OverlaidWidge... ) Removes a widget that was previously overlaid on to this viewport
void StartPlayInEditorSession ( UGameViewportClient* PlayClien..., const bool bInSimulateInEditor ) IAssetViewport Interface
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
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
void ToggleGameView () Called when game view should be toggled

Classes

Type Name Description
Public struct FArguments  

Constants

Name Description
bInViewportMenuEnabled  

Deprecated Functions

Type Name Description
EVisibility GetCurrentLevelButtonVisibility () GetCurrentLevelButtonVisibility not used anymore.
EVisibility GetCurrentLevelTextVisibility () GetCurrentLevelTextVisibility not used anymore.
FName GetViewportTypeWithinLayout () Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands
bool IsViewportConfigurationSet ( FName ConfigurationName ) Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands
bool IsViewportTypeWithinLayoutEqual ( FName InLayoutType ) Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands
void OnSetViewportConfiguration ( FName ConfigurationName ) Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands
void SetViewportTypeWithinLayout ( FName InLayoutType ) Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands
void ToggleViewportTypeActivationWithinLayout ( FName InLayoutType ) Moved to internal handling by FViewportTabContent. See FViewportTabContent::BindCommonViewportCommands

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library