FSplineComponentVisualizer

SplineComponent visualizer/edit functionality

Unreal Engine C++ API Reference > Editor > ComponentVisualizers

Inheritance Hierarchy

References

   
Module ComponentVisualizers
Header /Engine/Source/Editor/ComponentVisualizers/Public/SplineComponentVisualizer.h
Include #include "SplineComponentVisualizer.h"

Syntax

class FSplineComponentVisualizer :  
    public [FComponentVisualizer](API\Editor\UnrealEd\FComponentVisualizer),  
    public [FGCObject](API\Runtime\CoreUObject\UObject\FGCObject)  

Remarks

SplineComponent visualizer/edit functionality

Variables

Type Name Description
EAxis::Type AddKeyLockedAxis Axis to fix when adding new spline points.
bool bAllowDuplication Whether we currently allow duplication when dragging
bool bDuplicatingSplineKey Alt-drag: True when in process of duplicating a spline key.
bool bIsSnappingToActor Snap: True when in process of snapping to actor which needs to be Ctrl-Selected.
bool bUpdatingAddSegment Alt-drag: True when in process of adding end segment.
FDelegateHandle DeselectedInEditorDelegateHandle  
float DuplicateCacheSplitSegmentParam Alt-drag: Cached segment parameter for split segment at new control point
uint32 DuplicateDelay Alt-drag: Delays duplicating control point to accumulate sufficient drag input offset.
FVector DuplicateDelayAccumulatedDrag Alt-drag: Accumulates delayed drag offset.
TObjectPtr< USp... SelectionState Current selection state
ESplineComponen... SnapToActorMode Snap: Snap to actor mode.
TSharedPtr< FUI... SplineComponentVisualizerActions Output log commands
FProperty * SplineCurvesProperty  

Constructors

Type Name Description
  FSplineComponentVisualizer ()  

Destructors

Type Name Description
  ~FSplineComponentVisualizer ()  

Functions

Type Name Description
void AddSegment ( const FVector& InWorldPos, bool bAppend ) Add segment to beginning or end of spline
bool AreKeysSelected () Whether any keys are currently selected
bool AreMultipleKeysSelected () Whether a multiple spline keys are currently selected
bool CanAddKeyToSegment ()  
bool CanDeleteKey ()  
bool CanResetToAutomaticTangent ( EInterpCurveMode Mode )  
bool CanResetToDefault ()  
bool CanSelectSplinePoints ()  
void ChangeSelectionState ( int32 Index, bool bIsCtrlHeld ) Update the key selection state of the visualizer
void CreateSplineGeneratorPanel ()  
bool DuplicateKeyForAltDrag ( const FVector& InDrag ) Alt-drag: duplicates the selected spline key
float FindNearest ( const FVector& InLocalPos, int32 InSegmentStartIndex, FVector& OutSplinePos, FVector& OutSplineTangent ) Return spline data for point on spline closest to input point
void GenerateContextMenuSections ( FMenuBuilder& InMenuBuilder ) Add menu sections to the context menu
void GenerateLockAxisSubMenu ( FMenuBuilder& MenuBuilder ) Generate the submenu containing the lock axis types
void GenerateSelectSplinePointsSubMenu ( FMenuBuilder& MenuBuilder ) Generate the submenu containing available selection actions
void GenerateSnapAlignSubMenu ( FMenuBuilder& MenuBuilder ) Generate the submenu containing the available snap/align actions
void GenerateSplinePointTypeSubMenu ( FMenuBuilder& MenuBuilder ) Generate the submenu containing the available point types
void GenerateTangentTypeSubMenu ( FMenuBuilder& MenuBuilder ) Generate the submenu containing the available auto tangent types
USplineCompo... GetEditedSplineComponent () Get the spline component we are currently editing
const TSet< ... GetSelectedKeys ()  
bool GetSnapToActorMode ( ESplineComponentSnapMode& OutSnapM... ) Snapping: get snap to actor temporary mode
bool HandleSelectAllSplinePoints ( USplineComponent* InSplineComp... ) Select all spline points, , returns true if the spline component being edited has changed
bool HandleSelectFirstLastSplinePoint ( USplineComponent* InSplineComp..., bool bFirstPoint ) Select first or last spline point, returns true if the spline component being edited has changed
bool IsAnySelectedKeyIndexOutOfRange ( const USplineComponent* Comp ) Determine if any selected key index is out of range (perhaps because something external has modified the spline)
bool IsDiscontinuousSpline ()  
bool IsKeySelectionValid ()  
bool IsKeyTypeSet ( EInterpCurveMode Mode )  
bool IsLockAxisSet ( EAxis::Type InAxis )  
bool IsSingleKeySelected () Whether a single spline key is currently selected
bool IsVisualizingRollAndScale ()  
void OnAddKeyToSegment ()  
void OnDeleteKey ()  
void OnDeselectedInEditor ( TObjectPtr< USplineComponent > Spli... )  
void OnDuplicateKey () Duplicates selected spline keys in place
void OnLockAxis ( EAxis::Type InAxis )  
void OnResetToAutomaticTangent ( EInterpCurveMode Mode )  
void OnResetToDefault ()  
void OnSelectAllSplinePoints () Select all spline points, if no spline points selected yet the currently edited spline component will be set as well
void OnSelectFirstLastSplinePoint ( bool bFirstPoint ) Select first or last spline point
void OnSelectPrevNextSplinePoint ( bool bNextPoint, bool bAddToSelection ) Select next or prev spline point, loops when last point is currently selected
void OnSetDiscontinuousSpline ()  
void OnSetKeyType ( EInterpCurveMode Mode )  
void OnSetVisualizeRollAndScale ()  
void OnSnapAllToAxis ( EAxis::Type InAxis )  
void OnSnapKeyToActor ( const ESplineComponentSnapMode InSn... )  
void OnSnapKeyToNearestSplinePoint ( ESplineComponentSnapMode InSnapMode )  
void OnSnapSelectedToAxis ( EAxis::Type InAxis )  
void ResetAllowDuplication () Alt-drag: duplicates the selected spline key
void ResetTempModes () Reset temporary modes after inputs are handled.
void SelectSplinePoint ( int32 SelectIndex, bool bAddToSelection ) Select spline point at specified index
void SetCachedRotation ( const FQuat& NewRotation ) Sets the new cached rotation on the visualizer
void SetEditedSplineComponent ( const USplineComponent* InSpli... ) Helper function to set edited component we are currently editing
void SetSnapToActorMode ( const bool bInIsSnappingToActor, const ESplineComponentSnapMode InSn... ) Snapping: set snap to actor temporary mode
void SnapKeysToLastSelectedAxisPosition ( const EAxis::Type InAxis, TArray< int32 > InSnapKeys ) Snapping: snap keys to axis position of last selected key
void SnapKeyToActor ( const AActor* InActor, const ESplineComponentSnapMode Snap... ) Snapping: snap key to selected actor
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
void SplitSegment ( const FVector& InWorldPos, int32 InSegmentIndex, bool bCopyFromSegmentBeginIndex ) Split segment using given world position
bool TransformSelectedKeys ( EPropertyChangeType::Type InPropert..., const FVector& InDeltaTranslate, const FRotator& InDeltaRotate, const FVector& InDeltaScale ) Transforms selected tangent by given translate, rotate and scale
bool TransformSelectedTangent ( EPropertyChangeType::Type InPropert..., const FVector& InDeltaTranslate ) Transforms selected tangent by given translation
void UpdateAddSegment ( const FVector& InWorldPos ) Add segment to beginning or end of spline
bool UpdateDuplicateKeyForAltDrag ( const FVector& InDrag ) Alt-drag: updates duplicated selected spline key
const USplin... UpdateSelectedSplineComponent ( HComponentVisProxy* VisProxy ) Updates the component and selected properties if the component has changed
void UpdateSplitSegment ( const FVector& InDrag ) Update split segment based on drag offset

Overridden from FComponentVisualizer

Type Name Description
void DrawVisualization ( const UActorComponent* Compone..., const FSceneView* View, FPrimitiveDrawInterface* PDI ) Draw visualization for the supplied component
void DrawVisualizationHUD ( const UActorComponent* Compone..., const FViewport* Viewport, const FSceneView* View, FCanvas* Canvas ) Draw HUD on viewport for the supplied component
void EndEditing ()  
TSharedPtr< ... GenerateContextMenu ()  
bool GetCustomInputCoordinateSystem ( const FEditorViewportClient* V..., FMatrix& OutMatrix )  
UActorCompon... GetEditedComponent () Get currently edited component, this is needed to reset the active visualizer after undo/redo
bool GetWidgetLocation ( const FEditorViewportClient* V..., FVector& OutLocation )  
bool HandleBoxSelect ( const FBox& InBox, FEditorViewportClient* InViewp..., FViewport* InViewport ) Handle box select input
bool HandleFrustumSelect ( const FConvexVolume& InFrustum, FEditorViewportClient* InViewp..., FViewport* InViewport ) Handle frustum select input
bool HandleInputDelta ( FEditorViewportClient* Viewpor..., FViewport* Viewport, FVector& DeltaTranslate, FRotator& DeltaRotate, FVector& DeltaScale )  
bool HandleInputKey ( FEditorViewportClient* Viewpor..., FViewport* Viewport, FKey Key, EInputEvent Event )  
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.
bool HandleSnapTo ( const bool bInAlign, const bool bInUseLineTrace, const bool bInUseBounds, const bool bInUsePivot, AActor* InDestination ) Pass snap input to active visualizer
bool HasFocusOnSelectionBoundingBox ( FBox& OutBoundingBox ) Return whether focus on selection should focus on bounding box defined by active visualizer
bool IsVisualizingArchetype ()  
void OnRegister ()  
bool ShouldShowForSelectedSubcomponents ( const UActorComponent* Compone... ) Show this visualizer if the component is directly is selected
void TrackingStopped ( FEditorViewportClient* InViewp..., bool bInDidMove ) Gets called when the mouse tracking has stopped (dragging behavior)
bool VisProxyHandleClick ( FEditorViewportClient* InViewp..., HComponentVisProxy* VisProxy, const FViewportClick& Click )  

Overridden from FGCObject

Type Name Description
void AddReferencedObjects ( FReferenceCollector& Collector ) Pure virtual that must be overloaded by the inheriting class.
FString GetReferencerName () Overload this method to report a name for your referencer

Constants

Name Description
WeakExistingWindow  

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library