Navigation
API > API/Plugins > API/Plugins/UVEditorTools
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).
| Name | UUVToolSelectionAPI |
| Type | class |
| Header File | /Engine/Plugins/Editor/UVEditor/Source/UVEditorTools/Public/Selection/UVToolSelectionAPI.h |
| Include Path | #include "Selection/UVToolSelectionAPI.h" |
Syntax
UCLASS (MinimalAPI)
class UUVToolSelectionAPI : public UUVToolContextObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UUVToolContextObject → UUVToolSelectionAPI
Classes
| Name | Remarks |
|---|---|
| FSelectionChange | An object representing a selection that can be as an undo/redo item, usually emitted by the selection API itself. |
| FUnsetSelectionChange | An object representing an unset UV selection that can be as an undo/redo item, usually emitted by the selection API itself. |
Structs
| Name | Remarks |
|---|---|
| FHighlightOptions | |
| FLivePreviewSelectionUXSettings | Holds the properties of the UV Live Preview Selection (in 3d viewport) for customization. |
| FSelectionMechanicModeChangeOptions | Options for how a SetSelectionMechanicMode() call is performed. |
| FSelectionMechanicOptions |
Enums
Public
| Name | Remarks |
|---|---|
| EUVEditorSelectionMode | Mode of operation for the selection mechanic. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnPreSelectionChange | TMulticastDelegate_TwoParams< void, bool bEmitChangeAllowed, uint32 SelectionChangeType > | Broadcasted right before a selection change is applied (and therefore before a selection change transaction is emitted). | Selection/UVToolSelectionAPI.h |
| FOnSelectionChanged | TMulticastDelegate_TwoParams< void, bool bEmitChangeAllowed, uint32 SelectionChangeType > | Broadcasted after a selection change is applied (after the selection change transaction is emitted, if relevant). | Selection/UVToolSelectionAPI.h |
| FUVToolSelection | UE::Geometry::FUVToolSelection | Selection/UVToolSelectionAPI.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnDragSelectionChanged | FSimpleMulticastDelegate | Broadcasted whenever the marquee rectangle is changed, since these changes don't trigger normal selection broadcasts. | Selection/UVToolSelectionAPI.h | |
| OnPreSelectionChange | FOnPreSelectionChange | Selection/UVToolSelectionAPI.h | ||
| OnSelectionChanged | FOnSelectionChanged | Selection/UVToolSelectionAPI.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BeginChange() |
Preps a selection change transaction, if the user wants more control on what the previous and current selection is. | Selection/UVToolSelectionAPI.h | |
void ClearHighlight
(
bool bClearForUnwrap, |
Selection/UVToolSelectionAPI.h | ||
void ClearSelections
(
bool bBroadcast, |
Equivalent to calling SetSelections with an empty array. | Selection/UVToolSelectionAPI.h | |
void ClearUnsetElementAppliedMeshSelections
(
bool bBroadcast, |
Selection/UVToolSelectionAPI.h | ||
virtual void DrawHUD
(
FCanvas* Canvas, |
Selection/UVToolSelectionAPI.h | ||
bool EndChangeAndEmitIfModified
(
bool bBroadcast |
Ends the active change and emits it via the EmitChangeAPI | Selection/UVToolSelectionAPI.h | |
const UUVEditorMeshSelectionMechanic * GetSelectionMechanic() |
Most clients shouldn't need to touch the selection mechanic directly, but it can be useful for certain utility functions that exist on the mechanic. | Selection/UVToolSelectionAPI.h | |
const TArray< FUVToolSelection > & GetSelections () |
Returns the current selection. | Selection/UVToolSelectionAPI.h | |
FUVToolSelection::EType GetSelectionsType() |
Returns type (vertex/edge/triangle) of current selection. Undefined if selection is empty. | Selection/UVToolSelectionAPI.h | |
const TArray< FUVToolSelection > & GetUnsetElementAppliedMeshSelections() |
Selection/UVToolSelectionAPI.h | ||
FTransform GetUnwrapHighlightTransform() |
Selection/UVToolSelectionAPI.h | ||
FVector3d GetUnwrapSelectionBoundingBoxCenter
(
bool bForceRecalculate |
Gets the bounding box center of the current selection. | Selection/UVToolSelectionAPI.h | |
bool HaveSelections() |
Returns true when current selection is not empty. | Selection/UVToolSelectionAPI.h | |
| 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). | Selection/UVToolSelectionAPI.h | ||
void Initialize
(
UInteractiveToolManager* ToolManagerIn, |
Initialization functions: | Selection/UVToolSelectionAPI.h | |
bool IsActive () |
Returns true in between Initialize() and Shutdown(). | Selection/UVToolSelectionAPI.h | |
virtual void LivePreviewDrawHUD
(
FCanvas* Canvas, |
Selection/UVToolSelectionAPI.h | ||
virtual 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. | Selection/UVToolSelectionAPI.h | |
void RebuildAppliedPreviewHighlight() |
Selection/UVToolSelectionAPI.h | ||
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. | Selection/UVToolSelectionAPI.h | |
virtual void Render
(
IToolsContextRenderAPI* RenderAPI |
Called by the owner of the API. | Selection/UVToolSelectionAPI.h | |
void SetHighlightOptions
(
const FHighlightOptions& Options |
Selection/UVToolSelectionAPI.h | ||
void SetHighlightVisible
(
bool bUnwrapHighlightVisible, |
Changes the visibility of the highlight. | Selection/UVToolSelectionAPI.h | |
void SetLivePreviewSelectionUXSettings
(
const FLivePreviewSelectionUXSettings& Settings |
Sets the UV Live Preview Selection settings. | Selection/UVToolSelectionAPI.h | |
void SetSelectionMechanicEnabled
(
bool bEnabled |
Selection/UVToolSelectionAPI.h | ||
void SetSelectionMechanicMode
(
EUVEditorSelectionMode Mode, |
Sets the mechanic mode of operation. | Selection/UVToolSelectionAPI.h | |
void SetSelectionMechanicOptions
(
const FSelectionMechanicOptions& Options |
Selection/UVToolSelectionAPI.h | ||
void SetSelections
(
const TArray< FUVToolSelection >& SelectionsIn, |
Sets the current selection. | Selection/UVToolSelectionAPI.h | |
void SetTargets
(
const TArray< TObjectPtr< UUVEditorToolMeshInput > >& TargetsIn |
Should be called after Initialize() | Selection/UVToolSelectionAPI.h | |
void SetUnsetElementAppliedMeshSelections
(
const TArray< FUVToolSelection >& SelectionsIn, |
Selection/UVToolSelectionAPI.h | ||
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). | Selection/UVToolSelectionAPI.h |
Overridden from UUVToolContextObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual 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). | Selection/UVToolSelectionAPI.h | |
virtual void Shutdown() |
UUVToolContextObject. | Selection/UVToolSelectionAPI.h |