UEditorInteractiveToolsContext

[UEditorInteractiveToolsContext](API\Editor\EditorInteractiveToolsFramework\UEditorInteractiveToolsContext) is an extension/adapter of an InteractiveToolsContext designed for use in the UE Editor.

Unreal Engine C++ API Reference > Editor > EditorInteractiveToolsFramework

Inheritance Hierarchy

References

   
Module EditorInteractiveToolsFramework
Header /Engine/Source/Editor/Experimental/EditorInteractiveToolsFramework/Public/EdModeInteractiveToolsContext.h
Include #include "EdModeInteractiveToolsContext.h"

Syntax

class UEditorInteractiveToolsContext : public [UInteractiveToolsContext](API\Runtime\InteractiveToolsFramework\UInteractiveToolsContext)  

Remarks

UEditorInteractiveToolsContext is an extension/adapter of an InteractiveToolsContext designed for use in the UE Editor. Currently this implementation assumes that it is created by a Mode Manager (FEditorModeTools), and that the Mode Manager will call various API functions like Render() and Tick() when necessary.

allows it to be easily embedded inside an FEdMode. A set of functions are provided which can be called from the FEdMode functions of the same name. These will handle the data type conversions and forwarding calls necessary to operate the ToolsContext

Variables

Type Name Description
UGizmoViewConte... GizmoViewContext An object in which we save the current scene view information that gizmos can use on the game thread to figure out how big the gizmo is for hit testing.
TMap< FViewport... InvalidationMap Tools need to be able to Invalidate the view, in case it is not Realtime.
int32 InvalidationTimestamp Current invalidation timestamp, incremented by invalidation calls
FOnDrawHUD OnDrawHUD  
FOnRender OnRender  
FOnTick OnTick  
TOptional< EToo... PendingToolShutdownType  
TOptional< FStr... PendingToolToStart  
IToolsContextQu... QueriesAPI EdMode implementation of InteractiveToolFramework APIs - see ToolContextInterfaces.h.
TObjectPtr< UMa... StandardVertexColorMaterial  
IToolsContextTr... TransactionAPI  

Constructors

Type Name Description
  UEditorInteractiveToolsContext ()  

Functions

Type Name Description
void Activate ()  
bool ActiveToolHasAccept ()  
bool CanAcceptActiveTool ()  
bool CanCancelActiveTool ()  
bool CanCompleteActiveTool ()  
bool CanStartTool ( const FString ToolTypeIdentifier ) Utility functions useful for hooking up to UICommand/etc
void Deactivate ()  
void DrawHUD ( FViewportClient* ViewportClien..., FViewport* Viewport, const FSceneView* View, FCanvas* Canvas )  
void EndTool ( EToolShutdownType ShutdownType )  
bool GetAbsoluteWorldSnappingEnabled ()  
FString GetActiveToolName ()  
bool GetEnableRenderingDuringHitProxyPass ()  
bool GetForceCombinedGizmoModeEnabled ()  
FRay GetLastWorldRay ()  
FEditorModeT... GetParentEditorModeManager ()  
IToolsContex... GetQueriesAPI ()  
FRay GetRayFromMousePos ( FEditorViewportClient* Viewpor..., FViewport* Viewport, int MouseX, int MouseY ) Utility function to convert viewport x/y from mouse events (and others?) into scene ray.
IToolsContex... GetTransactionAPI ()  
UWorld * GetWorld ()  
bool HasActiveTool ()  
void InitializeContextWithEditorModeManager ( FEditorModeTools* InEditorMode..., UInputRouter* UseInputRouter ) Initialize a new ToolsContext for an EdMode owned by the given InEditorModeManager
void OnEditorSelectionSetChanged ( const UTypedElementSelectionSet... ) Handle Editor selection changes
void OnLevelEditorCreated ( TSharedPtr< ILevelEditor > InLevelE... ) Called upon Level Editor Created in order to bind to EditorElementSelectionPtr changed event since global selection set is not initialized before the tools context.
void OnToolEnded ( UInteractiveToolManager* InToo..., UInteractiveTool* InEndedTool )  
void OnToolPostBuild ( UInteractiveToolManager* InToo..., EToolSide InSide, UInteractiveTool* InBuiltTool, UInteractiveToolBuilder* InToo..., const FToolBuilderState& ToolState )  
void PostInvalidation () Call this to notify the Editor that the viewports this ToolsContext is related to may need a repaint, ie during interactive tool usage
bool ProcessEditDelete ()  
void Render ( const FSceneView* View, FViewport* Viewport, FPrimitiveDrawInterface* PDI )  
void RestoreEditorState ()  
void SetAbsoluteWorldSnappingEnabled ( bool bEnabled ) Configure whether Transform Gizmos created by the ITF (eg CombinedTransformGizmo) should, when in World coordinate system, snap to an Absolute world-aligned grid, or snap Relative to the initial position of any particular gizmo transform.
void SetEditorStateForTool () Editor UI state that we set before starting tool and when exiting tool Currently disabling anti-aliasing during active Tools because it causes PDI flickering
void SetEnableRenderingDuringHitProxyPass ( bool bEnabled ) Configuration functions Configure whether Render() should early-out for HitProxy rendering passes.
void SetForceCombinedGizmoMode ( bool bEnabled ) Configure whether Transform Gizmos created by the ITF (eg CombinedTransformGizmo) should prefer to show in 'Combined' mode.
void ShutdownContext () Shutdown ToolsContext and clean up any connections/etc
void StartTool ( const FString ToolTypeIdentifier )  
void TerminateActiveToolsOnLevelChange () Default behavior is to cancel active tool
void TerminateActiveToolsOnPIEStart () Default behavior is to accept active tool
void TerminateActiveToolsOnSaveWorld () Default behavior is to accept active tool
void TerminateActiveToolsOnWorldTearDown () Default behavior is to cancel active tool
void Tick ( FEditorViewportClient* Viewpor..., float DeltaTime ) Call functions of the same name on the ToolManager and GizmoManager

Overridden from UInteractiveToolsContext

Type Name Description
void DeactivateActiveTool ( EToolSide WhichSide, EToolShutdownType ShutdownType )  
void DeactivateAllActiveTools ( EToolShutdownType ShutdownType )  
void Initialize ( IToolsContextQueriesAPI* Queri..., IToolsContextTransactionsAPI* ... ) We hide these
void Shutdown () Shutdown Context by destroying InputRouter and ToolManager

Typedefs

Name Description
FOnDrawHUD  
FOnRender These delegates can be used to hook into the Render() / DrawHUD() / Tick() calls above.
FOnTick  

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library