FSplineComponentVisualizer

SplineComponent visualizer/edit functionality

Windows
MacOS
Linux

Inheritance Hierarchy

FComponentVisualizer

FGCObject

FSplineComponentVisualizer

References

Module

ComponentVisualizers

Header

/Engine/Source/Editor/ComponentVisualizers/Public/SplineComponentVisualizer.h

Include

#include "SplineComponentVisualizer.h"

Syntax

class FSplineComponentVisualizer :
    public FComponentVisualizer,
    public FGCObject

Remarks

SplineComponent visualizer/edit functionality

Variables

Name Description

Protected variable

EAxis::Type

 

AddKeyLockedAxis

Axis to fix when adding new spline points.

Protected variable

bool

 

bAllowDuplication

Whether we currently allow duplication when dragging

Protected variable

bool

 

bDuplicatingSplineKey

Alt-drag: True when in process of duplicating a spline key.

Protected variable

bool

 

bIsSnappingToActor

Snap: True when in process of snapping to actor which needs to be Ctrl-Selected.

Protected variable

bool

 

bUpdatingAddSegment

Alt-drag: True when in process of adding end segment.

Protected variable

float

 

DuplicateCacheSplitSegmentParam

Alt-drag: Cached segment parameter for split segment at new control point

Protected variable

uint32

 

DuplicateDelay

Alt-drag: Delays duplicating control point to accumulate sufficient drag input offset.

Protected variable

FVector

 

DuplicateDelayAccumulatedDrag

Alt-drag: Accumulates delayed drag offset.

Protected variable

USplineComponen...

 

SelectionState

Current selection state

Protected variable

ESplineComponen...

 

SnapToActorMode

Snap: Snap to actor mode.

Protected variable

TSharedPtr< FUI...

 

SplineComponentVisualizerActions

Output log commands

Protected variable

FProperty *

 

SplineCurvesProperty

Constructors

Name Description

Public function

FSplineComponentVisualizer()

Destructors

Functions

Name Description

Protected function Virtual

void

 

AddSegment

(
    const FVector& InWorldPos,
    bool bAppend
)

Add segment to beginning or end of spline

Protected function Const

bool

 

AreKeysSelected()

Whether any keys are currently selected

Protected function Const

bool

 

AreMultipleKeysSelected()

Whether a multiple spline keys are currently selected

Protected function Const

bool

 

CanAddKeyToSegment()

Protected function Const

bool

 

CanDeleteKey()

Protected function Const

bool

 

CanResetToAutomaticTangent

(
    EInterpCurveMode Mode
)

Protected function Const

bool

 

CanResetToDefault()

Protected function Const

bool

 

CanSelectSplinePoints()

Protected function Virtual

void

 

ChangeSelectionState

(
    int32 Index,
    bool bIsCtrlHeld
)

Update the key selection state of the visualizer

Protected function

void

 

CreateSplineGeneratorPanel()

Protected function Virtual

bool

 

DuplicateKeyForAltDrag

(
    const FVector& InDrag
)

Alt-drag: duplicates the selected spline key

Protected function Virtual Const

float

 

FindNearest

(
    const FVector& InLocalPos,
    int32 InSegmentStartIndex,
    FVector& OutSplinePos,
    FVector& OutSplineTangent
)

Return spline data for point on spline closest to input point

Public function Virtual Const

void

 

GenerateContextMenuSections

(
    FMenuBuilder& InMenuBuilder
)

Add menu sections to the context menu

Protected function Const

void

 

GenerateLockAxisSubMenu

(
    FMenuBuilder& MenuBuilder
)

Generate the submenu containing the lock axis types

Protected function Const

void

 

GenerateSelectSplinePointsSubMenu

(
    FMenuBuilder& MenuBuilder
)

Generate the submenu containing available selection actions

Protected function Const

void

 

GenerateSnapAlignSubMenu

(
    FMenuBuilder& MenuBuilder
)

Generate the submenu containing the available snap/align actions

Protected function Const

void

 

GenerateSplinePointTypeSubMenu

(
    FMenuBuilder& MenuBuilder
)

Generate the submenu containing the available point types

Protected function Const

void

 

GenerateTangentTypeSubMenu

(
    FMenuBuilder& MenuBuilder
)

Generate the submenu containing the available auto tangent types

Public function Const

USplineCompo...

 

GetEditedSplineComponent()

Get the spline component we are currently editing

Public function Const

const TSet< ...

 

GetSelectedKeys()

Protected function Virtual Const

bool

 

GetSnapToActorMode

(
    ESplineComponentSnapMode& OutSnapM...
)

Snapping: get snap to actor temporary mode

Public function

bool

 

HandleSelectAllSplinePoints

(
    USplineComponent* InSplineComp...
)

Select all spline points, , returns true if the spline component being edited has changed

Public function

bool

 

HandleSelectFirstLastSplinePoint

(
    USplineComponent* InSplineComp...,
    bool bFirstPoint
)

Select first or last spline point, returns true if the spline component being edited has changed

Protected function Const

bool

 

IsAnySelectedKeyIndexOutOfRange

(
    const USplineComponent* Comp
)

Determine if any selected key index is out of range (perhaps because something external has modified the spline)

Protected function Const

bool

 

IsDiscontinuousSpline()

Protected function Const

bool

 

IsKeySelectionValid()

Protected function Const

bool

 

IsKeyTypeSet

(
    EInterpCurveMode Mode
)

Protected function Const

bool

 

IsLockAxisSet

(
    EAxis::Type InAxis
)

Protected function Const

bool

 

IsSingleKeySelected()

Whether a single spline key is currently selected

Protected function Const

bool

 

IsVisualizingRollAndScale()

Protected function

void

 

OnAddKeyToSegment()

Protected function

void

 

OnDeleteKey()

Protected function

void

 

OnDuplicateKey()

Duplicates selected spline keys in place

Protected function

void

 

OnLockAxis

(
    EAxis::Type InAxis
)

Protected function

void

 

OnResetToAutomaticTangent

(
    EInterpCurveMode Mode
)

Protected function

void

 

OnResetToDefault()

Protected function

void

 

OnSelectAllSplinePoints()

Select all spline points, if no spline points selected yet the currently edited spline component will be set as well

Protected function

void

 

OnSelectFirstLastSplinePoint

(
    bool bFirstPoint
)

Select first or last spline point

Public function

void

 

OnSelectPrevNextSplinePoint

(
    bool bNextPoint,
    bool bAddToSelection
)

Select next or prev spline point, loops when last point is currently selected

Protected function

void

 

OnSetDiscontinuousSpline()

Protected function

void

 

OnSetKeyType

(
    EInterpCurveMode Mode
)

Protected function

void

 

OnSetVisualizeRollAndScale()

Protected function

void

 

OnSnapAllToAxis

(
    EAxis::Type InAxis
)

Protected function

void

 

OnSnapKeyToActor

(
    const ESplineComponentSnapMode InSn...
)

Protected function

void

 

OnSnapKeyToNearestSplinePoint

(
    ESplineComponentSnapMode InSnapMode
)

Protected function

void

 

OnSnapSelectedToAxis

(
    EAxis::Type InAxis
)

Protected function Virtual

void

 

ResetAllowDuplication()

Alt-drag: duplicates the selected spline key

Protected function Virtual

void

 

ResetTempModes()

Reset temporary modes after inputs are handled.

Protected function

void

 

SelectSplinePoint

(
    int32 SelectIndex,
    bool bAddToSelection
)

Select spline point at specified index

Public function

void

 

SetCachedRotation

(
    const FQuat& NewRotation
)

Sets the new cached rotation on the visualizer

Protected function

void

 

SetEditedSplineComponent

(
    const USplineComponent* InSpli...
)

Helper function to set edited component we are currently editing

Protected function Virtual

void

 

SetSnapToActorMode

(
    const bool bInIsSnappingToActor,
    const ESplineComponentSnapMode InSn...
)

Snapping: set snap to actor temporary mode

Protected function Virtual

void

 

SnapKeysToLastSelectedAxisPosition

(
    const EAxis::Type InAxis,
    TArray< int32 > InSnapKeys
)

Snapping: snap keys to axis position of last selected key

Protected function Virtual

void

 

SnapKeyToActor

(
    const AActor* InActor,
    const ESplineComponentSnapMode Snap...
)

Snapping: snap key to selected actor

Protected function Virtual

void

 

SnapKeyToTransform

(
    const ESplineComponentSnapMode InSn...,
    const FVector& InWorldPos,
    const FVector& InWorldUpVector,
    const FVector& InWorldForwardVecto...,
    const FVector& InScale,
    const USplineMetadata* InCopyS...,
    const int32 InCopySplineMetadataKey
)

Snapping: generic method for snapping selected keys to given transform

Protected function Virtual

void

 

SplitSegment

(
    const FVector& InWorldPos,
    int32 InSegmentIndex
)

Split segment using given world position

Protected function

bool

 

TransformSelectedKeys

(
    const FVector& DeltaTranslate,
    const FRotator& DeltaRotate,
    const FVector& DeltaScale
)

Transforms selected tangent by given translate, rotate and scale

Protected function

bool

 

TransformSelectedTangent

(
    const FVector& DeltaTranslate
)

Transforms selected tangent by given translation

Protected function Virtual

void

 

UpdateAddSegment

(
    const FVector& InWorldPos
)

Add segment to beginning or end of spline

Protected function Virtual

bool

 

UpdateDuplicateKeyForAltDrag

(
    const FVector& InDrag
)

Alt-drag: updates duplicated selected spline key

Protected function

const USplin...

 

UpdateSelectedSplineComponent

(
    HComponentVisProxy* VisProxy
)

Updates the component and selected properties if the component has changed

Protected function Virtual

void

 

UpdateSplitSegment

(
    const FVector& InDrag
)

Update split segment based on drag offset

Overridden from FComponentVisualizer

Name Description

Public function Virtual

void

 

DrawVisualization

(
    const UActorComponent* Compone...,
    const FSceneView* View,
    FPrimitiveDrawInterface* PDI
)

Draw visualization for the supplied component

Public function Virtual

void

 

DrawVisualizationHUD

(
    const UActorComponent* Compone...,
    const FViewport* Viewport,
    const FSceneView* View,
    FCanvas* Canvas
)

Draw HUD on viewport for the supplied component

Public function Virtual

void

 

EndEditing()

Public function Virtual Const

TSharedPtr< ...

 

GenerateContextMenu()

Public function Virtual Const

bool

 

GetCustomInputCoordinateSystem

(
    const FEditorViewportClient* V...,
    FMatrix& OutMatrix
)

Public function Virtual Const

UActorCompon...

 

GetEditedComponent()

Get currently edited component, this is needed to reset the active visualizer after undo/redo

Public function Virtual Const

bool

 

GetWidgetLocation

(
    const FEditorViewportClient* V...,
    FVector& OutLocation
)

Public function Virtual

bool

 

HandleBoxSelect

(
    const FBox& InBox,
    FEditorViewportClient* InViewp...,
    FViewport* InViewport
)

Handle box select input

Public function Virtual

bool

 

HandleFrustumSelect

(
    const FConvexVolume& InFrustum,
    FEditorViewportClient* InViewp...,
    FViewport* InViewport
)

Handle frustum select input

Public function Virtual

bool

 

HandleInputDelta

(
    FEditorViewportClient* Viewpor...,
    FViewport* Viewport,
    FVector& DeltaTranslate,
    FRotator& DeltaRotate,
    FVector& DeltaScale
)

Public function Virtual

bool

 

HandleInputKey

(
    FEditorViewportClient* Viewpor...,
    FViewport* Viewport,
    FKey Key,
    EInputEvent Event
)

Public function Virtual

bool

 

HandleModifiedClick

(
    FEditorViewportClient* InViewp...,
    HHitProxy* HitProxy,
    const FViewportClick& Click
)

Handle click modified by Alt, Ctrl and/or Shift. The input HitProxy may not be on this component.

Public function Virtual

bool

 

HandleSnapTo

(
    const bool bInAlign,
    const bool bInUseLineTrace,
    const bool bInUseBounds,
    const bool bInUsePivot,
    AActor* InDestination
)

Pass snap input to active visualizer

Public function Virtual

bool

 

HasFocusOnSelectionBoundingBox

(
    FBox& OutBoundingBox
)

Return whether focus on selection should focus on bounding box defined by active visualizer

Public function Virtual Const

bool

 

IsVisualizingArchetype()

Public function Virtual

void

 

OnRegister()

Public function Virtual

bool

 

VisProxyHandleClick

(
    FEditorViewportClient* InViewp...,
    HComponentVisProxy* VisProxy,
    const FViewportClick& Click
)

Overridden from FGCObject

Name Description

Protected function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Pure virtual that must be overloaded by the inheriting class.

Constants

Name

Description

WeakExistingWindow

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