UUVEditorMode

The UV editor mode is the mode used in the UV asset editor.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

UVEditor

Header

/Engine/Plugins/Experimental/UVEditor/Source/UVEditor/Public/UVEditorMode.h

Include

#include "UVEditorMode.h"

Syntax

UCLASS(Transient)
class UUVEditorMode : public UEdMode

Remarks

The UV editor mode is the mode used in the UV asset editor. It holds most of the inter-tool state. We put things in a mode instead of directly into the asset editor in case we want to someday use the mode in multiple asset editors.

Variables

Name Description

Protected variable

TArray< TShared...

 

AppliedCanonicalMeshes

1:1 with the asset arrays.

Protected variable

TArray< TObject...

 

AppliedPreviews

1:1 with AppliedCanonicalMeshes, the actual displayed 3d meshes that can be used by tools for background computations.

Protected variable

TArray< FString...

 

AssetNames

1:1 with ToolTargets, indexed by AssetID

Public variable UProperty

TObjectPtr< UUV...

 

BackgroundVisualization

Holds the background visualiztion.

Protected variable

bool

 

bIsActive

Protected variable

FString

 

DefaultToolIdentifier

Protected variable UProperty

TObjectPtr< UWo...

 

LivePreviewWorld

Here largely for convenience to avoid having to pass it around functions.

Protected variable

TSet< int32 >

 

ModifiedAssetIDs

Authoritative list of targets that have changes that have not been baked back yet.

Protected variable UProperty

TArray< TObject...

 

OriginalObjectsToEdit

Stores original input objects, for instance UStaticMesh pointers.

Protected variable

TArray< int32 >

 

PendingUVLayerIndex

Protected variable UProperty

TArray< TObject...

 

PropertyObjectsToTick

Mode-level property objects (visible or not) that get ticked.

Protected variable UProperty

TArray< TObject...

 

ToolInputObjects

Input objects we give to the tools, one per displayed UV layer.

Protected variable UProperty

TArray< TObject...

 

ToolTargets

Tool targets created from OriginalObjectsToEdit (and 1:1 with that array) that provide us with dynamic meshes whose UV layers we unwrap.

Protected variable

TArray< FTransf...

 

Transforms

Transforms that should be used for the 3d previews, 1:1 with OriginalObjectsToEdit and ToolTargets.

Protected variable

TArray< TWeakOb...

 

WireframesToTick

Wireframes have to get ticked to be able to respond to setting changes.

Constructors

Name Description

Public function

UUVEditorMode()

Functions

Name Description

Public function

void

 

ApplyChanges()

Public function

void

 

ChangeInputObjectLayer

(
    int32 AssetID,
    int32 NewLayerIndex
)

Public for use by undo/redo. Otherwise should use RequestUVChannelChange.

Public function

void

 

EmitToolIndependentObjectChange

(
    UObject* TargetObject,
    TUniquePtr< FToolCommandChange > Ch...,
    const FText& Description
)

TODO: We'll probably eventually want a function like this so we can figure out how big our 3d preview scene is and how we should position the camera intially...

Public function Const

const TArray...

 

GetAssetNames()

Public function

void

 

GetAssetsWithUnappliedChanges

(
    TArray< TObjectPtr< UObject >> Unap...
)

Public function

UObject *...

 

GetBackgroundSettingsObject()

Public function Const

int32

 

GetDisplayedChannel

(
    int32 AssetID
)

Public function Const

int32

 

GetNumUVChannels

(
    int32 AssetID
)

Public function Static

const FToolT...

 

GetToolTargetRequirements()

Gets the tool target requirements for the mode.

Public function Static

double

 

GetUVMeshScalingFactor()

Gets the factor by which UV layer unwraps get scaled (scaling makes certain things easier, like zooming in, etc).

Public function

bool

 

HaveUnappliedChanges()

Asset management.

Public function

void

 

InitializeContexts

(
    FEditorViewportClient& LivePreview...,
    FAssetEditorModeManager& LivePrevi...,
    UUVToolViewportButtonsAPI& Viewpor...
)

Both initialization functions must be called for things to function properly.

Public function

void

 

InitializeTargets

(
    const TArray< TObjectPtr< UObject >...,
    const TArray< FTransform >& Transf...
)

Public function

bool

 

IsActive()

Public function Virtual

bool

 

IsDefaultToolActive()

This is currently not part of the base class at all... Should it be?

Public function

void

 

RegisterTools()

Public function

void

 

RequestUVChannelChange

(
    int32 AssetID,
    int32 Channel
)

Request a change of the displayed UV channel/layer.

Protected function

void

 

SetDisplayedUVChannels

(
    const TArray< int32 >& LayerPerAss...,
    bool bEmitUndoTransaction
)

Used with the ToolAssetAndLayerAPI to process tool layer change requests.

Protected function

void

 

UpdatePreviewMaterialBasedOnBackground()

Protected function

void

 

UpdateTriangleMaterialBasedOnBackground

(
    bool IsBackgroundVisible
)

Overridden from UEdMode

Name Description

Public function Virtual

void

 

ActivateDefaultTool()

We're changing visibility of this one to public here so that we can call it from the toolkit when clicking accept/cancel buttons.

Protected function Virtual

void

 

BindCommands()

Not sure whether we need these yet.

Protected function Virtual

void

 

CreateToolkit()

Public function Virtual

void

 

Enter()

Public function Virtual

void

 

Exit()

Public function Virtual

void

 

ModeTick

(
    float DeltaTime
)

Protected function Virtual

void

 

OnToolEnded

(
    UInteractiveToolManager* Manag...,
    UInteractiveTool* Tool
)

Protected function Virtual

void

 

OnToolStarted

(
    UInteractiveToolManager* Manag...,
    UInteractiveTool* Tool
)

Public function Virtual Const

bool

 

ShouldToolStartBeAllowed

(
    const FString& ToolIdentifier
)

Subclasses can override this to add additional checks on whether a tool should be allowed to start.

Constants