IMeshPainter

Base class for creating a mesh painter, has basic functionality combined with IMeshPaintMode and requires painting/situation-specific information to do actual painting

Windows
MacOS
Linux

References

Module

MeshPaint

Header

/Engine/Source/Editor/MeshPaint/Public/IMeshPainter.h

Include

#include "IMeshPainter.h"

Syntax

class IMeshPainter

Remarks

Base class for creating a mesh painter, has basic functionality combined with IMeshPaintMode and requires painting/situation-specific information to do actual painting

Variables

Name Description

Protected variable

bool

 

bArePainting

Flag for whether or not we are currently painting

Protected variable

UViewportIntera...

 

CurrentViewportInteractor

When painting in VR, this is viewport interactor we are using

Protected variable

FLinearColor

 

HoverVertexPointColor

Protected variable

FScopedTransact...

 

PaintTransaction

Painting transaction instance which is currently active

Protected variable

float

 

Time

Overall time value kept for drawing effects

Protected variable

float

 

TimeSinceStartedPainting

Time kept since the user has started painting

Protected variable

TSharedPtr< FUI...

 

UICommandList

Protected variable

FLinearColor

 

VertexPointColor

Protected variable

FLinearColor

 

WidgetLineColor

Protected variable

float

 

WidgetLineThickness

Constructors

Name Description

Public function

IMeshPainter()

Destructors

Name Description

Public function Virtual

~IMeshPainter()

Functions

Name Description

Public function

void

 

ActorDeselected

(
    AActor* Actor
)

Is called by the owning EdMode when an actor is selected in the viewport

Public function

void

 

ActorSelected

(
    AActor* Actor
)

Is called by the owning EdMode when an actor is de-selected in the viewport

Public function

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Functionality to collect painter referenced objects to prevent GC

Protected function

void

 

BeginTransaction

(
    const FText Description
)

Begins and keeps track of an Editor transaction with the given Description

Protected function

void

 

EndTransaction()

Ends the current transaction

Public function Virtual

void

 

FinishPainting()

If painting is in progress will propagate changes and cleanup the painting state

Public function

UPaintBrushS...

 

GetBrushSettings()

Returns an instance of UPaintBrushSettings (base or derived) which contains the basic settings used for painting

Public function

const FHitRe...

 

GetHitResult

(
    const FVector& Origin,
    const FVector& Direction
)

Returns a HitResult structure given a origin and direction to trace a ray for

Public function

TSharedPtr< ...

 

GetMeshAdapterForComponent

(
    const UMeshComponent* Componen...
)

Tries to retrieves a valid mesh adapter for the given component (derived painters can cache these hence no base implementation)

Public function

UMeshPaintSe...

 

GetPainterSettings()

Returns an instance of UMeshPainterSettings used for specific types of painting

Public function

TSharedPtr< ...

 

GetWidget()

Returns a SWidget which represents the painters state and allows for changes / extra functionality

Public function Virtual

bool

 

InputKey

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport,
    FKey InKey,
    EInputEvent InEvent
)

Allows painter to act on specific key actions

Public function Virtual

bool

 

IsPainting()

Returns whether or not painting (of any sorts) is in progress

Public function Virtual

bool

 

Paint

(
    FViewport* Viewport,
    const FVector& InCameraOrigin,
    const TArrayView< TPair< FVector, F...
)

'Normal' painting functionality, called when the user tries to paint on a mesh using the mouse

Public function Virtual

bool

 

Paint

(
    FViewport* Viewport,
    const FVector& InCameraOrigin,
    const FVector& InRayOrigin,
    const FVector& InRayDirection
)

'Normal' painting functionality, called when the user tries to paint on a mesh using the mouse

Protected function

bool

 

PaintInternal

(
    const FVector& InCameraOrigin,
    const TArrayView< TPair< FVector, F...,
    EMeshPaintAction PaintAction,
    float PaintStrength
)

Internal painting functionality, is called from Paint and PaintVR and implemented in the derived painters

Public function Virtual

bool

 

PaintVR

(
    FViewport* Viewport,
    const FVector& InCameraOrigin,
    const FVector& InRayOrigin,
    const FVector& InRayDirection,
    UVREditorInteractor* VREditorI...
)

VR painting functionality, called when the user tries to paint on a mesh using a VR controller

Public function

void

 

Refresh()

Refreshes the underlying data

Public function Virtual

void

 

RegisterCommands

(
    TSharedRef< FUICommandList > Comman...
)

Registers a base set of commands for altering UBrushSettings

Public function

void

 

Render

(
    const FSceneView* View,
    FViewport* Viewport,
    FPrimitiveDrawInterface* PDI
)

Renders ray widgets for the active viewport interactors

Protected function

void

 

RenderInteractors

(
    const FSceneView* View,
    FViewport* Viewport,
    FPrimitiveDrawInterface* PDI,
    bool bRenderVertices,
    ESceneDepthPriorityGroup DepthGroup
)

Renders viewport interactor widget

Protected function Virtual

void

 

RenderInteractorWidget

(
    const FVector& InCameraOrigin,
    const FVector& InRayOrigin,
    const FVector& InRayDirection,
    FPrimitiveDrawInterface* PDI,
    EMeshPaintAction PaintAction,
    bool bRenderVertices,
    ESceneDepthPriorityGroup DepthGroup
)

Functionality for rendering the interactor widget given its positional information and paint action

Public function

void

 

Reset()

Resets the state of the painter

Public function Virtual

void

 

Tick

(
    FEditorViewportClient* Viewpor...,
    float DeltaTime
)

Base ticking functionality, keeps track of time and caches VR interactors

Public function Virtual

void

 

UnregisterCommands

(
    TSharedRef< FUICommandList > Comman...
)

Unregisters a base set of commands

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss