UUVEditorToolMeshInput

A package of the needed information for an asset being operated on by a UV editor tool.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

UVEditorTools

Header

/Engine/Plugins/Experimental/UVEditor/Source/UVEditorTools/Public/ToolTargets/UVEditorToolMeshInput.h

Include

#include "ToolTargets/UVEditorToolMeshInput.h"

Syntax

UCLASS()
class UUVEditorToolMeshInput : public UToolTarget

Remarks

A package of the needed information for an asset being operated on by a UV editor tool. It includes a UV unwrap mesh, a mesh with the UV layer applied, and background-op-compatible previews for each. It also has convenience methods for updating all of the represenations from just one of them, using a "fast update" code path when possible.

This tool target is a bit different from usual in that it is not created by a tool target manager, and therefore doesn't have an accompanying factory. Instead, it is created by the mode, because the mode has access to the worlds in which the previews need to be created.

It's arguable whether this should even inherit from UToolTarget.

Variables

Name Description

Public variable

TSharedPtr< UE:...

 

AppliedCanonical

A UV layer, also have a primary UV overlay that represents the same layer, to make it possible to someday texture the unwrap.

Public variable UProperty

TObjectPtr< UMe...

 

AppliedPreview

3d preview of the asset with the UV layer updated, suitable for use with background ops.

Public variable

int32

 

AssetID

Public variable

FOnObjectModifi...

 

OnCanonicalModified

Public variable

TObjectPtr< UTo...

 

SourceTarget

Additional needed information.

Public variable

TSharedPtr< UE:...

 

UnwrapCanonical

Mesh representing the unwrapped UV layer.

Public variable UProperty

TObjectPtr< UMe...

 

UnwrapPreview

Preview of the unwrapped UV layer, suitable for being manipulated by background ops.

Public variable

int32

 

UVLayerIndex

Public variable

TFunction< FVec...

 

UVToVertPosition

Mappings used for generating and baking back the unwrap.

Public variable

TFunction< FVec...

 

VertPositionToUV

Public variable UProperty

TObjectPtr< UMe...

 

WireframeDisplay

Optional: a wireframe to track the mesh in unwrap preview.

Functions

Name Description

Public function

void

 

AppliedVidToUnwrapVids

(
    int32 AppliedVid,
    TArray< int32 >& UnwrapVidsOut
)

Get the unwrap vids corresponding to a given applied vid.

Public function

bool

 

InitializeMeshes

(
    UToolTarget* Target,
    TSharedPtr< UE::Geometry::FDynamicM...,
    UMeshOpPreviewWithBackgroundCompute...,
    int32 AssetID,
    int32 UVLayerIndex,
    UWorld* UnwrapWorld,
    UWorld* LivePreviewWorld,
    UMaterialInterface* WorkingMat...,
    TFunction< FVector3d...,
    TFunction< FVector2f...
)

Public function

void

 

Shutdown()

Public function

int32

 

UnwrapVidToAppliedVid

(
    int32 UnwrapVid
)

Convert a vid in the unwrap mesh to the corresponding vid in the applied mesh (i.e., parent vertex of the element corresponding to the unwrap vertex).

Public function

void

 

UpdateAllFromAppliedCanonical

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...,
    bool bBroadcast
)

Updates the other meshes using the mesh in AppliedCanonical.

Public function

void

 

UpdateAllFromAppliedPreview

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...,
    bool bBroadcast
)

Updates the other meshes using the UV overlay in the live preview.

Public function

void

 

UpdateAllFromUnwrapCanonical

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...,
    bool bBroadcast
)

Updates the other meshes using the mesh in UnwrapCanonical.

Public function

void

 

UpdateAllFromUnwrapPreview

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...,
    bool bBroadcast
)

Updates the other meshes using the mesh in UnwrapPreview.

Public function

void

 

UpdateAppliedPreviewFromUnwrapPreview

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...
)

Updates the AppliedPreview from UnwrapPreview, without updating the non-preview meshes.

Public function

void

 

UpdateCanonicalFromPreviews

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    bool bBroadcast
)

Updates the non-preview meshes from their preview counterparts.

Public function

void

 

UpdateFromCanonicalUnwrapUsingMeshChange

(
    const UE::Geometry::FDynamicMeshCha...,
    bool bBroadcast
)

Uses the stored triangles/vertices in the mesh change to update everything from the canonical unwrap.

Public function

void

 

UpdatePreviewsFromCanonical

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...
)

Updates the preview meshes from their canonical counterparts.

Public function

void

 

UpdateUnwrapCanonicalOverlayFromPositions

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...
)

Updates UnwrapCanonical UV Overlay from UnwrapCanonical vert positions.

Public function

void

 

UpdateUnwrapPreviewFromAppliedPreview

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...
)

Updates only the UnwrapPreview from AppliedPreview, without updating the non-preview meshes.

Public function

void

 

UpdateUnwrapPreviewOverlayFromPositions

(
    const TArray< int32 >* Changed...,
    const TArray< int32 >* Changed...,
    const TArray< int32 >* FastRen...
)

Updates UnwrapPreview UV Overlay from UnwrapPreview vert positions.

Overridden from UToolTarget

Name Description

Public function Virtual Const

bool

 

IsValid()

UToolTarget.

Classes

Name

Description

Public struct

FCanonicalModifiedInfo

Information about an OnCanonicalModified broadcast.

Typedefs

Name

Description

FOnObjectModified

Broadcast when the canonical unwrap or applied meshes change.

Constants

Name

Description

NONE_CHANGED_ARG

Notes above the below convenience functions: