UBaseMeshProcessingTool

[UBaseMeshProcessingTool](API\Plugins\ModelingComponents\BaseTools\UBaseMeshProcessingTool) is a base Tool (ie has no functionality of it's own and must be subclassed) that provides the following structure:

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/BaseTools/BaseMeshProcessingTool.h

Include

#include "BaseTools/BaseMeshProcessingTool.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UBaseMeshProcessingTool :
    public USingleSelectionTool,
    public IDynamicMeshOperatorFactory

Remarks

UBaseMeshProcessingTool is a base Tool (ie has no functionality of it's own and must be subclassed) that provides the following structure:

  • a Background-Compute-With-Preview Temp Actor/Component is created based on the input mesh

  • The Subclass provides FDynamicMeshOperator instances (via IDynamicMeshOperatorFactory) that process/modify and update this Preview

  • PropertySets with custom visibility can be registered, and on change will invalidate the current computation

Optional support for a WeightMap property set and tracking of active weight map can be enabled by calling AddWeightMapPropertySet(), GetActiveWeightMap() will then return the active WeightMap, and changes to the WeightMap selection will invalidate the computation.

Most subclasses will only need to define their PropertySets and implement MakeNewOperator(), see eg SmoothMeshTool for a minimal example

Other functions:

The Base tool will do various optional precomputations or changes to the input mesh, which can be configured by overriding various functions below.

RequiresInitialVtxNormals() : return true (default=false) to calculate per-vertex normals on the input mesh, returned by GetInitialVtxNormals()

RequiresInitialBoundaryLoops() : return true (default=false) to calculate boundary loops on the input mesh, returned by GetInitialBoundaryLoops()

RequiresScaleNormalization() : return true (default=true) to apply an initial scale to the input mesh so that it has consistent size before being sent into the computation. Scaling factor (eg for scaling UI constants) can be accessed via GetScaleNormalizationFactor()

Variables

Name Description

Protected variable

IToolsContextAs...

 

AssetAPI

Protected variable

TArray< FOption...

 

OptionalProperties

Protected variable UProperty

UMeshOpPreviewW...

 

Preview

Preview object holds temporary Actor with preview mesh component.

Protected variable

UWorld *

 

TargetWorld

Constructors

Name Description

Public function

UBaseMeshProcessingTool()

Functions

Name Description

Protected function Virtual

void

 

AddOptionalPropertySet

(
    UInteractiveToolPropertySet* P...,
    TUniqueFunction< bool()> Visibility...,
    TUniqueFunction< void()> OnModified...,
    bool bChangeInvalidatesResult
)

Protected function

PropSetType ...

 

AddOptionalPropertySet

(
    TUniqueFunction< bool()> Visibility...,
    TUniqueFunction< void()> OnModified...,
    bool bChangeInvalidatesResult
)

Register an optional property set with the given VisibilityFunc, and call OnModifiedFunc if any of the properties change

Protected function

PropSetType ...

 

AddOptionalPropertySet

(
    TUniqueFunction< bool()> Visibility...,
    bool bChangeInvalidatesResult
)

Optional Property Set API - subclasses can use this to manage property sets with configurable visibility that invalidate the precompute Register an optional property set with the given VisibilityFunc

Protected function

PropSetType ...

 

AddWeightMapPropertySet

(
    TUniqueFunction< bool()> Visibility...
)

Optional weight map support Weight map will only be enabled if base class registers a weight map property set

Protected function Virtual Const

FText

 

GetAcceptTransactionName()

Protected function

TSharedPtr< ...

 

GetActiveWeightMap()

Protected function

TSharedPtr< ...

 

GetInitialBoundaryLoops()

Protected function Const

const FDynam...

 

GetInitialMesh()

Protected function

FDynamicMesh...

 

GetInitialMesh()

Protected function

TSharedPtr< ...

 

GetInitialVtxNormals()

Protected function Const

const FTrans...

 

GetPreviewTransform()

Protected function Const

double

 

GetScaleNormalizationFactor()

Protected function Virtual Const

FText

 

GetToolMessageString()

UBaseMeshProcessingTool OPTIONAL API - subclasses may implement these functions

Protected function Const

UPreviewMesh...

 

GetUPreviewMesh()

Protected function Const

bool

 

HasActiveWeightMap()

Protected function Virtual Const

bool

 

HasMeshTopologyChanged()

Called when Tool is Accepted to determine whether it is safe to only update vertex positions, or if entire target mesh must be replaced.

Protected function Virtual

void

 

InitializeProperties()

This function is called during Setup() to allow subclass to register property sets, before kicking off initial computation

Protected function Virtual

void

 

InvalidateResult()

Protected function Virtual

void

 

OnOptionalPropSetModified

(
    int32 Index
)

Protected function Virtual

void

 

OnShutdown

(
    EToolShutdownType ShutdownType
)

This function is called during ::Shutdown so that subclass may perform final processing and save property sets

Protected function Virtual Const

bool

 

RequiresInitialBoundaryLoops()

Optional base mesh boundary loops.

Protected function Virtual Const

bool

 

RequiresInitialVtxNormals()

Optional base mesh per-vertex normals.

Protected function Virtual Const

bool

 

RequiresScaleNormalization()

Optional uniform scale applied to mesh.

Protected function Virtual

void

 

SavePropertySets()

Protected function Virtual

void

 

SetupWeightMapPropertySet

(
    UWeightMapSetProperties* Prope...
)

Public function Virtual

void

 

SetWorld

(
    UWorld* World
)

Protected function Virtual

void

 

UpdateOptionalPropertyVisibility()

Call this function to update optional property sets visibility. Should call base implementation

Protected function Virtual

void

 

UpdateResult()

Overridden from UInteractiveTool

Name Description

Public function Virtual Const

bool

 

CanAccept()

Public function Virtual Const

bool

 

HasAccept()

Public function Virtual Const

bool

 

HasCancel()

Public function Virtual

void

 

OnTick

(
    float DeltaTime
)

Action support/system

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

Allow the Tool to do any custom drawing (ie via PDI/RHI)

Public function Virtual

void

 

Setup()

InteractiveTool API - generally does not need to be modified by subclasses

Public function Virtual

void

 

Shutdown

(
    EToolShutdownType ShutdownType
)

Called by ToolManager to shut down the Tool

Overridden from IDynamicMeshOperatorFactory

Name Description

Protected function Virtual

TUniquePtr< ...

 

MakeNewOperator()

UBaseMeshProcessingTool REQUIRED API - subclasses must implement these functions IDynamicMeshOperatorFactory implementation that subclass must override and implement

Classes

Name

Description

Protected struct

FOptionalPropertySet

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