Navigation
API > API/Plugins > API/Plugins/UVEditorTools > API/Plugins/UVEditorTools/Selection
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UUVToolContextObject
- UUVToolSelectionAPI
References
| Module | UVEditorTools |
| Header | /Engine/Plugins/Editor/UVEditor/Source/UVEditorTools/Public/Selection/UVToolSelectionAPI.h |
| Include | #include "Selection/UVToolSelectionAPI.h" |
Syntax
UCLASS&40;&41;
class UUVToolSelectionAPI : public UUVToolContextObject
Remarks
API for dealing with mode-level selection in the UV editor.
Selections are stored in a list of objects, one object per asset that contains a selection, all of the same type (vert/edge/tri), none empty. Selections are considered to be referring to the UnwrapCanonical mesh of the corresponding target.
There are also functions to enable automatic highlighting of the current selection, and to enable a selection mechanic in the viewport (to which tools can respond via OnSelectionChanged broadcasts).
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bCachedUnwrapSelectionBoundingBoxCenterValid | ||
| bool | bIsActive | ||
| FVector3d | CachedUnwrapSelectionBoundingBoxCenter | ||
| TArray< FUVToolSelection > | CurrentSelections | ||
| TArray< FUVToolSelection > | CurrentUnsetSelections | ||
| TObjectPtr< UUVToolEmitChangeAPI > | EmitChangeAPI | ||
| TObjectPtr< UUVToolSelectionHighlightMechanic > | HighlightMechanic | ||
| FHighlightOptions | HighlightOptions | ||
| TObjectPtr< UUVEditorMechanicAdapterTool > | MechanicAdapter | ||
| FSimpleMulticastDelegate | OnDragSelectionChanged | Broadcasted whenever the marquee rectangle is changed, since these changes don't trigger normal selection broadcasts. | |
| FOnPreSelectionChange | OnPreSelectionChange | ||
| FOnSelectionChanged | OnSelectionChanged | ||
| TUniquePtr< FSelectionChange > | PendingSelectionChange | ||
| TUniquePtr< FUnsetSelectionChange > | PendingUnsetSelectionChange | ||
| TObjectPtr< UUVEditorMeshSelectionMechanic > | SelectionMechanic | ||
| TArray< TObjectPtr< UUVEditorToolMeshInput > > | Targets | ||
| TWeakObjectPtr< UInputRouter > | UnwrapInputRouter |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | BeginChange () |
Preps a selection change transaction, if the user wants more control on what the previous and current selection is. | |
| void | ClearHighlight
(
bool bClearForUnwrap, |
||
| void | ClearSelections
(
bool bBroadcast, |
Equivalent to calling SetSelections with an empty array. | |
| void | ClearUnsetElementAppliedMeshSelections
(
bool bBroadcast, |
||
| void | DrawHUD
(
FCanvas* Canvas, |
||
| bool | EndChangeAndEmitIfModified
(
bool bBroadcast |
Ends the active change and emits it via the EmitChangeAPI | |
| const TArray< FUVToolSelection > & | Returns the current selection. | ||
| FUVToolSelection::EType | Returns type (vertex/edge/triangle) of current selection. Undefined if selection is empty. | ||
| const TArray< FUVToolSelection > & | |||
| FTransform | |||
| FVector3d | GetUnwrapSelectionBoundingBoxCenter
(
bool bForceRecalculate |
Gets the bounding box center of the current selection. | |
| bool | Returns true when current selection is not empty. | ||
| bool | These are functions that are used if a selection made in the applied mesh cannot be converted to an unwrap mesh selection due to unset UV elements (meaning that the selected portion does not exist in the unwrap mesh). | ||
| void | Initialize
(
UInteractiveToolManager* ToolManagerIn, |
Initialization functions: | |
| bool | IsActive () |
Returns true in between Initialize() and Shutdown(). | |
| void | LivePreviewDrawHUD
(
FCanvas* Canvas, |
||
| void | LivePreviewRender
(
IToolsContextRenderAPI* RenderAPI |
Could have had the api place these into the LivePreviewAPI delegates, but decided against it to align with Render() and DrawHUD() above. | |
| void | |||
| void | RebuildUnwrapHighlight
(
const FTransform& StartTransform |
Build up a highlight of the current selection in the Unwrap, with a given transform considered as its start transform. | |
| void | Render
(
IToolsContextRenderAPI* RenderAPI |
Called by the owner of the API. | |
| void | SetHighlightOptions
(
const FHighlightOptions& Options |
||
| void | SetHighlightVisible
(
bool bUnwrapHighlightVisible, |
Changes the visibility of the highlight. | |
| void | SetSelectionMechanicEnabled
(
bool bEnabled |
||
| void | SetSelectionMechanicMode
(
EUVEditorSelectionMode Mode, |
Sets the mechanic mode of operation. | |
| void | SetSelectionMechanicOptions
(
const FSelectionMechanicOptions& Options |
||
| void | SetSelections
(
const TArray< FUVToolSelection >& SelectionsIn, |
Sets the current selection. | |
| void | SetTargets
(
const TArray< TObjectPtr< UUVEditorToolMeshInput >>& TargetsIn |
Should be called after Initialize() | |
| void | SetUnsetElementAppliedMeshSelections
(
const TArray< FUVToolSelection >& SelectionsIn, |
||
| void | SetUnwrapHighlightTransform
(
const FTransform& NewTransform |
Change the transform of the unwrap highlight without rebuilding it (for cheap movement of the highlight when translating the elements). |
Overridden from UUVToolContextObject
| Type | Name | Description | |
|---|---|---|---|
| void | OnToolEnded
(
UInteractiveTool* DeadTool |
Called whenever a tool is ended, for instance to let a context object remove listeners associated with that tool (it shouldn't have to do so, but may choose to for robustness). | |
| void | Shutdown () |
UUVToolContextObject. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FHighlightOptions | |||
| FSelectionChange | An object representing a selection that can be as an undo/redo item, usually emitted by the selection API itself. | ||
| FSelectionMechanicModeChangeOptions | Options for how a SetSelectionMechanicMode() call is performed. | ||
| FSelectionMechanicOptions | |||
| FUnsetSelectionChange | An object representing an unset UV selection that can be as an undo/redo item, usually emitted by the selection API itself. |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EUVEditorSelectionMode | Mode of operation for the selection mechanic. |
Typedefs
| Name | Description |
|---|---|
| FOnPreSelectionChange | Broadcasted right before a selection change is applied (and therefore before a selection change transaction is emitted). |
| FOnSelectionChanged | Broadcasted after a selection change is applied (after the selection change transaction is emitted, if relevant). |
| FUVToolSelection |