FLevelEditorViewportClient

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/LevelEditorViewport.h

Include

#include "LevelEditorViewport.h"

Syntax

class FLevelEditorViewportClient : public FEditorViewportClient

Variables

Name Description

Public variable

bool

 

bAlwaysShowModeWidgetAfterSelectionChanges

When enabled, the Unreal transform widget will become visible after an actor is selected, even if it was turned off via a show flag

Public variable

bool

 

bDrawBaseInfo

Indicates whether, of not, the base attachment volume should be drawn for this viewport.

Public variable

bool

 

bDuplicateActorsInProgress

BDuplicateActorsOnNextDrag will not be set again while bDuplicateActorsInProgress is true.

Public variable

bool

 

bDuplicateOnNextDrag

Used for drag duplication.

Public variable

bool

 

bEnableColorScaling

Public variable

bool

 

bEnableFading

Public variable

bool

 

bHasBegunGizmoManipulation

True if gizmo manipulation was started from a tracking event

Public variable

bool

 

bIsTrackingBrushModification

True when a brush is being transformed by its Widget

Public variable

bool

 

bLockedCameraView

True if this viewport is to change its view (aspect ratio, post processing, FOV etc) to match that of the currently locked camera, if applicable

Public variable

bool

 

bNeedToRestoreComponentBeingMovedFlag

True if the viewport needs to restore the flag when tracking ends

Public variable

bool

 

bOnlyMovedPivot

True if only the pivot position has been moved

Public variable

bool

 

bReceivedFocusRecently

Whether this viewport recently received focus.

Public variable

FVector

 

ColorScale

Public variable

float

 

FadeAmount

Public variable

FLinearColor

 

FadeColor

Public variable

FVector

 

LastEditorViewLocation

The viewport location that is restored when exiting PIE

Public variable

FRotator

 

LastEditorViewRotation

The viewport orientation that is restored when exiting PIE

Public variable

TWeakPtr< class...

 

ParentLevelEditor

Parent level editor that owns this viewport.

Public variable

TArray< FName >

 

ViewHiddenLayers

List of layers that are hidden in this view

Public variable

TBitArray

 

VolumeActorVisibility

Special volume actor visibility settings.

Constructors

Name Description

Public function

FLevelEditorViewportClient

(
    const TSharedPtr< class SLevelViewp...
)

Constructor

Destructors

Name Description

Public function Virtual

~FLevelEditorViewportClient()

Destructor

Functions

Name Description

Public function Static

void

 

AddHoverEffect

(
    const FViewportHoverTarget& InHove...
)

Static: Adds a hover effect to the specified object

Public function

void

 

ApplyDeltaToActor

(
    AActor* InActor,
    const FVector& InDeltaDrag,
    const FRotator& InDeltaRot,
    const FVector& InDeltaScale
)

Public function

void

 

ApplyDeltaToActors

(
    const FVector& InDrag,
    const FRotator& InRot,
    const FVector& InScale
)

Public function

void

 

ApplyDeltaToComponent

(
    USceneComponent* InComponent,
    const FVector& InDeltaDrag,
    const FRotator& InDeltaRot,
    const FVector& InDeltaScale
)

Public function

void

 

ApplyDeltaToElement

(
    const FTypedElementHandle& InEleme...,
    const FTransform& InDeltaTransform
)

Public function

void

 

ApplyDeltaToSelectedElements

(
    const FTransform& InDeltaTransform
)

Public function Const

bool

 

CanApplyMaterialToHitProxy

(
    const HHitProxy* HitProxy
)

Called to check if a material can be applied to an object, given the hit proxy

Protected function

bool

 

CanDropBlueprintAsset

(
    const FSelectedAssetInfo&
)

Checks the viewport to see if the given blueprint asset can be dropped on the viewport.

Public function Static

void

 

ClearHoverFromObjects()

Static: Clears viewport hover effects from any objects that currently have that

Public function

void

 

CopyLayoutFromViewport

(
    const FLevelEditorViewportClient& ...
)

Copies layout and camera settings from the specified viewport

Public function

void

 

DrawTextureStreamingBounds

(
    const FSceneView* View,
    FPrimitiveDrawInterface* PDI
)

Draw the texture streaming bounds.

Public function Static

UActorCompon...

 

FindViewComponentForActor

(
    AActor const* Actor
)

Find a view component to use for the specified actor.

Public function Const

TWeakObjectP...

 

GetActiveActorLock()

Access the 'active' actor lock.

Public function Const

const FLevel...

 

GetActorLock()

Gets the actor lock. This is the actor locked to the viewport via the viewport menus.

Public function

FLevelViewpo...

 

GetActorLock()

Gets the actor lock. This is the actor locked to the viewport via the viewport menus.

Public function Const

UCameraCompo...

 

GetCameraComponentForView()

Find the camera component that is driving this viewport, in the following order of preference:

Public function Const

const FLevel...

 

GetCinematicActorLock()

Get the actor locked to the viewport by cinematic tools like Sequencer.

Public function

FLevelViewpo...

 

GetCinematicActorLock()

Get the actor locked to the viewport by cinematic tools like Sequencer.

Public function Static

const TArray...

 

GetDropPreviewActors()

Public function Const

FVector2D

 

GetDropPreviewLocation()

Public function

FTypedElemen...

 

GetElementsToManipulate

(
    const bool bForceRefresh
)

Get the elements (from the current selection set) that this viewport can manipulate (eg, via the transform gizmo).

Public function

bool

 

GetFocusBounds

(
    FTypedElementListConstRef InElement...,
    FBoxSphereBounds& OutBounds
)

Public function Const

EAxisList::T...

 

GetHorizAxis()

Returns the horizontal axis for this viewport.

Public function Const

bool

 

GetIsCameraCut()

Public function Static

UObject *...

 

GetOrCreateMaterialFromTexture

(
    UTexture* UnrealTexture
)

Static: Given a texture, returns a material for that texture, creating a new asset if necessary.

Public function Const

const FLevel...

 

GetPreviousActorLock()

Gets the previous actor lock. This is the actor locked to the viewport via the viewport menus.

Public function Const

const FLevel...

 

GetPreviousCinematicActorLock()

Get the previous actor locked to the viewport by cinematic tools like Sequencer.

Public function Const

bool

 

GetSpriteCategoryVisibility

(
    const FName& InSpriteCategory
)

Returns whether the provided unlocalized sprite category is visible in the viewport or not

Public function Const

bool

 

GetSpriteCategoryVisibility

(
    int32 Index
)

Returns whether the sprite category specified by the provided index is visible in the viewport or not

Public function Const

EAxisList::T...

 

GetVertAxis()

Returns the vertical axis for this viewport.

Protected function

void

 

HandleViewportSettingChanged

(
    FName PropertyName
)

Callback for when an editor user setting has changed

Public function

void

 

InitializeViewportInteraction()

Initialize viewport interaction

Public function

void

 

InitializeVisibilityFlags()

Initialize visibility flags

Public function Const

bool

 

IsActorLocked

(
    const TWeakObjectPtr< const AActor ...
)

Check to see if this actor is locked by the viewport

Public function Const

bool

 

IsAnyActorLocked()

Check to see if any actor is locked by the viewport

Public function Static

bool

 

IsDroppingPreviewActor()

Returns true if creating a preview actor in the viewport.

Public function Const

bool

 

IsLockedToActor

(
    AActor* Actor
)

Check whether this viewport is locked to the specified actor

Public function Const

bool

 

IsLockedToCinematic()

Check whether this viewport is locked to display a cinematic camera, like a Sequencer camera.

Public function Const

bool

 

IsVolumeVisibleInViewport

(
    const AActor& VolumeActor
)

Returns true if the passed in volume is visible in the viewport (due to volume actor visibility flags)

Public function

void

 

MirrorSelectedActors

(
    const FVector& InMirrorScale
)

Public function

void

 

MirrorSelectedElements

(
    const FVector& InMirrorScale
)

Public function

void

 

MoveCameraToLockedActor()

Moves the viewport camera according to the locked actors location and rotation

Protected function

void

 

OnActorMoved

(
    AActor* InActor
)

Delegate handler for ActorMoved events

Protected function

void

 

OnEditorCleanse()

Called when editor cleanse event is triggered

Protected function

void

 

OnMapChanged

(
    UWorld* InWorld,
    EMapChangeType MapChangeType
)

Callback for when a map is created or destroyed

Protected function

void

 

OnPreBeginPIE

(
    const bool bIsSimulating
)

Called before the editor tries to begin PIE

Public function

void

 

PrepareCameraForPIE()

Stores camera settings that may be adversely affected by PIE, so that they may be restored later

Public function Static

void

 

RemoveHoverEffect

(
    const FViewportHoverTarget& InHove...
)

Static: Removes a hover effect to the specified object

Public function

void

 

RemoveReferenceToWorldContext

(
    FWorldContext& WorldContext
)

Public function

void

 

ResetCamera()

Reset the camera position and rotation. Used when creating a new level.

Public function

void

 

ResetViewForNewMap()

Reset the view for a new map

Public function

void

 

RestoreCameraFromPIE()

Restores camera settings that may be adversely affected by PIE

Public function

void

 

SetActorLock

(
    const FLevelViewportActorLock& InA...
)

Set the actor lock. This is the actor locked to the viewport via the viewport menus.

Public function

void

 

SetActorLock

(
    AActor* Actor
)

Set the actor lock. This is the actor locked to the viewport via the viewport menus.

Public function

void

 

SetAllSpriteCategoryVisibility

(
    bool bVisible
)

Sets the visibility of all sprite categories to the provided value

Public function

void

 

SetCinematicActorLock

(
    AActor* Actor
)

Set the actor locked to the viewport by cinematic tools like Sequencer.

Public function

void

 

SetCinematicActorLock

(
    const FLevelViewportActorLock& InA...
)

Set the actor locked to the viewport by cinematic tools like Sequencer.

Public function

void

 

SetCurrentViewport()

Set the global ptr to the current viewport

Public function

void

 

SetEditingThroughMovementWidget()

Informs the renderer that the view is being interactively edited.

Public function

void

 

SetIsCameraCut()

Sets a flag for this frame indicating that the camera has been cut, and temporal effects (such as motion blur) should be reset

Protected function Static

void

 

SetIsDroppingPreviewActor

(
    bool bNewIsDroppingPreviewActor
)

Sets the state of creating a preview actor in the viewport.

Public function

void

 

SetLastKeyViewport()

Set the global ptr to the last viewport to receive a key press

Public function

void

 

SetReferenceToWorldContext

(
    FWorldContext& WorldContext
)

Public function

void

 

SetSpriteCategoryVisibility

(
    const FName& InSpriteCategory,
    bool bVisible
)

Sets the visibility of the provided unlocalized category to the provided value

Public function

void

 

SetSpriteCategoryVisibility

(
    int32 Index,
    bool bVisible
)

Sets the visibility of the category specified by the provided index to the provided value

Public function

void

 

SetViewportTypeFromTool

(
    ELevelViewportType InViewportType
)

Calling SetViewportType from Dragtool_ViewportChange

Public function

bool

 

ShouldUseMoveCanvasMovement()

Determines if the new MoveCanvas movement should be used

Public function Static

TArray< AAct...

 

TryPlacingActorFromObject

(
    ULevel* InLevel,
    UObject* ObjToUse,
    bool bSelectActors,
    EObjectFlags ObjectFlags,
    UActorFactory* FactoryToUse,
    const FName Name,
    const FViewportCursorLocation*...
)

Static: Attempts to place the specified object in the level, returning one or more newly-created actors if successful.

Public function

void

 

UpdateAudioListener

(
    const FSceneView& View
)

Updates the audio listener for this viewport

Public function

void

 

UpdateHoveredObjects

(
    const TSet< FViewportHoverTarget > ...
)

Public function

void

 

UpdateViewForLockedActor

(
    float DeltaTime
)

Updates or resets view properties such as aspect ratio, FOV, location etc to match that of any actor we are locked to

Overridden from FEditorViewportClient

Name Description

Public function Virtual

void

 

AbortTracking()

Aborts mouse tracking (stop and cancel)

Public function Virtual

void

 

BeginCameraMovement

(
    bool bHasMovement
)

Handle the camera about to be moved or stopped

Public function Virtual

FSceneView &...

 

CalcSceneView

(
    FSceneViewFamily* ViewFamily,
    const int32 StereoViewIndex
)

Configures the specified FSceneView object with the view and projection matrices for this viewport.

Public function Virtual

FDropQuery

 

CanDropObjectsAtCoordinates

(
    int32 MouseX,
    int32 MouseY,
    const FAssetData& AssetInfo
)

Checks the viewport to see if the given object can be dropped using the given mouse coordinates local to this viewport

Public function Virtual

void

 

CheckHoveredHitProxy

(
    HHitProxy* HoveredHitProxy
)

Checks if the mouse is hovered over a hit proxy and decides what to do.

Public function Virtual

void

 

DestroyDropPreviewActors()

If dragging an actor for placement, this function destroys the actor.

Public function Virtual

void

 

DrawCanvas

(
    FViewport& InViewport,
    FSceneView& View,
    FCanvas& Canvas
)

Called to draw onto the viewports 2D canvas

Public function Virtual

bool

 

DropObjectsAtCoordinates

(
    int32 MouseX,
    int32 MouseY,
    const TArray< UObject* >& Dro...,
    TArray< AActor* >& OutNewActo...,
    bool bOnlyDropOnTarget,
    bool bCreateDropPreview,
    bool bSelectActors,
    UActorFactory* FactoryToUse
)

Attempts to intelligently drop the given objects in the viewport, using the given mouse coordinates local to this viewport

Public function Virtual

void

 

EndCameraMovement()

Protected function Virtual Const

bool

 

GetActiveSafeFrame

(
    float& OutAspectRatio
)

Helper used by DrawSafeFrames to get the current safe frame aspect ratio.

Public function Virtual Const

FLinearColor

 

GetBackgroundColor()

Public function Virtual Const

float

 

GetCameraSpeedScalar()

Get the camera speed scalar for this viewport

Public function Virtual Const

int32

 

GetCameraSpeedSetting()

Get the camera speed setting for this viewport

Public function Virtual Const

bool

 

GetPivotForOrbit

(
    FVector& OutPivot
)

Get the custom pivot point around which the camera should orbit for this viewport

Public function Virtual Const

ELevelViewpo...

 

GetViewportType()

Returns the effective viewport type (taking into account any actor locking or camera possession)

Public function Virtual Const

FMatrix

 

GetWidgetCoordSystem()

Public function Virtual Const

FVector

 

GetWidgetLocation()

Public function Virtual Const

UE::Widget::...

 

GetWidgetMode()

Public function Virtual Const

bool

 

HasDropPreviewActors()

Returns true if a placement dragging actor exists

Public function Virtual

bool

 

InputWidgetDelta

(
    FViewport* InViewport,
    EAxisList::Type CurrentAxis,
    FVector& Drag,
    FRotator& Rot,
    FVector& Scale
)

Called to give the viewport client a chance to handle widgets being moved

Public function Virtual Const

bool

 

IsLevelEditorClient()

If true, this is a level editor viewport

Public function Virtual

TSharedPtr< ...

 

MakeDragTool

(
    EDragTool::Type DragToolType
)

Called to make a drag tool when the user starts dragging in the viewport

Public function Virtual

void

 

NudgeSelectedObjects

(
    const FInputEventState& InputState
)

Public function Virtual

void

 

OverridePostProcessSettings

(
    FSceneView& View
)

Called to override any post process settings for the view

Protected function Virtual

void

 

PerspectiveCameraMoved()

Called when the perspective viewport camera moves

Public function Virtual

void

 

ProcessClick

(
    FSceneView& View,
    HHitProxy* HitProxy,
    FKey Key,
    EInputEvent Event,
    uint32 HitX,
    uint32 HitY
)

Called when the user clicks in the viewport

Protected function Virtual

void

 

RedrawAllViewportsIntoThisScene()

Invalidates this and other linked viewports (anything viewing the same scene)

Public function Virtual

void

 

RotateViewportType()

Rotate through viewport view options

Public function Virtual

void

 

SetCameraSpeedScalar

(
    float SpeedScalar
)

Set the camera speed scalar for this viewport

Public function Virtual

void

 

SetCameraSpeedSetting

(
    int32 SpeedSetting
)

Set the speed setting for the camera in this viewport

Public function Virtual

void

 

SetupViewForRendering

(
    FSceneViewFamily& ViewFamily,
    FSceneView& View
)

Called to do any additional set up of the view for rendering

Public function Virtual

void

 

SetViewportType

(
    ELevelViewportType InViewportType
)

Set the viewport type of the client

Public function Virtual

void

 

SetVREditView

(
    bool bGameViewEnable
)

Public function Virtual Const

bool

 

ShouldLockPitch()

Public function Virtual Const

bool

 

ShouldScaleCameraSpeedByDistance()

Public function Virtual

void

 

Tick

(
    float DeltaSeconds
)

Ticks this viewport client

Public function Virtual

void

 

TrackingStarted

(
    const FInputEventState& InInputSta...,
    bool bIsDraggingWidget,
    bool bNudge
)

Called when mouse movement tracking begins

Public function Virtual

void

 

TrackingStopped()

Called when mouse movement tracking stops

Public function Virtual

bool

 

UpdateDropPreviewActors

(
    int32 MouseX,
    int32 MouseY,
    const TArray< UObject* >& Dro...,
    bool& out_bDroppedObjectsVisible,
    UActorFactory* FactoryToUse
)

If dragging an actor for placement, this function updates its position.

Public function Virtual

void

 

UpdateLinkedOrthoViewports

(
    bool bInvalidate
)

FEditorViewportClient Interface

Public function Virtual Const

bool

 

UseAppTime()

Should this viewport use app time instead of world time.

Overridden from FViewportClient

Name Description

Public function Virtual

void

 

CapturedMouseMove

(
    FViewport* InViewport,
    int32 InMouseX,
    int32 InMouseY
)

Called when the mouse is moved while a window input capture is in effect

Public function Virtual

void

 

ConditionalRestoreWorld

(
    UWorld* InWorld
)

Restores GWorld to InWorld

Public function Virtual

UWorld *

 

ConditionalSetWorld()

Sets GWorld to the appropriate world for this client

Public function Virtual

EMouseCursor...

 

GetCursor

(
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Retrieves the cursor that should be displayed by the OS

Public function Virtual Const

UWorld *

 

GetWorld()

Use the viewports Scene to get a world.

Public function Virtual

bool

 

InputAxis

(
    FViewport* Viewport,
    FInputDeviceId InputDevice,
    FKey Key,
    float Delta,
    float DeltaTime,
    int32 NumSamples,
    bool bGamepad
)

Check an axis movement received by the viewport.

Public function Virtual

bool

 

InputKey

(
    const FInputKeyEventArgs& EventArg...
)

Check a key event received by the viewport.

Public function Virtual

void

 

LostFocus

(
    FViewport* InViewport
)

Public function Virtual

void

 

MouseMove

(
    FViewport* InViewport,
    int32 x,
    int32 y
)

Public function Virtual

bool

 

OverrideHighResScreenshotCaptureRegion

(
    FIntRect& OutCaptureRegion
)

Allow viewport client to override the current capture region

Public function Virtual

void

 

ReceivedFocus

(
    FViewport* InViewport
)

Public function Virtual

void

 

SetIsSimulateInEditorViewport

(
    bool bInIsSimulateInEditorViewport
)

Overridden from FViewElementDrawer

Name Description

Public function Virtual

void

 

Draw

(
    const FSceneView* View,
    FPrimitiveDrawInterface* PDI
)

FViewElementDrawer interface

Overridden from FGCObject

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

GC references.

Serialization.

Constants

Name

Description

bIsDroppingPreviewActor

If currently creating a preview actor.

DropPreviewActors

The actors that are currently being placed in the viewport via dragging

HoveredObjects

Static: List of objects we're hovering over

ViewComponentForActorCache

Caching for expensive FindViewComponentForActor. Invalidated once per Tick.

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