| UObjectBase
|
Module |
|
Header |
/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/BaseTools/BaseMeshProcessingTool.h |
Include |
#include "BaseTools/BaseMeshProcessingTool.h" |
[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UBaseMeshProcessingTool :
public USingleSelectionTool,
public IDynamicMeshOperatorFactory
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:
GetInitialMesh() : return reference to copy of initial mesh, used to initialize FDynamicMeshOperator
GetUPreviewMesh() : return the UPreviewMesh inside the background compute (for configuration/etc - should not directly touch the mesh!)
GetPreviewTransform() : return active FTransform on the Preview mesh, should be passed to FDynamicMeshOperator unless it is outputting world position
InvalidateResult() : subclasses call this to notify the base class that current result/computation has been invalidated
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()
Name | Description | ||
---|---|---|---|
|
AssetAPI |
||
|
OptionalProperties |
||
|
Preview |
Preview object holds temporary Actor with preview mesh component. |
|
|
UWorld * |
TargetWorld |
Name | Description | |
---|---|---|
|
UBaseMeshProcessingTool() |
Name | Description | ||
---|---|---|---|
|
AddOptionalPropertySet ( |
||
|
PropSetType ... |
AddOptionalPropertySet ( |
Register an optional property set with the given VisibilityFunc, and call OnModifiedFunc if any of the properties change |
|
PropSetType ... |
AddOptionalPropertySet ( |
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 |
|
PropSetType ... |
AddWeightMapPropertySet ( |
Optional weight map support Weight map will only be enabled if base class registers a weight map property set |
|
GetAcceptTransactionName() |
||
|
TSharedPtr< ... |
GetActiveWeightMap() |
|
|
TSharedPtr< ... |
GetInitialBoundaryLoops() |
|
|
const FDynam... |
GetInitialMesh() |
|
|
FDynamicMesh... |
GetInitialMesh() |
|
|
TSharedPtr< ... |
GetInitialVtxNormals() |
|
|
const FTrans... |
GetPreviewTransform() |
|
|
double |
GetScaleNormalizationFactor() |
|
|
GetToolMessageString() |
UBaseMeshProcessingTool OPTIONAL API - subclasses may implement these functions |
|
|
UPreviewMesh... |
GetUPreviewMesh() |
|
|
HasActiveWeightMap() |
||
|
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. |
|
|
InitializeProperties() |
This function is called during Setup() to allow subclass to register property sets, before kicking off initial computation |
|
|
InvalidateResult() |
||
|
OnOptionalPropSetModified ( |
||
|
OnShutdown ( |
This function is called during ::Shutdown so that subclass may perform final processing and save property sets |
|
|
RequiresInitialBoundaryLoops() |
Optional base mesh boundary loops. |
|
|
RequiresInitialVtxNormals() |
Optional base mesh per-vertex normals. |
|
|
RequiresScaleNormalization() |
Optional uniform scale applied to mesh. |
|
|
SavePropertySets() |
||
|
SetupWeightMapPropertySet ( |
||
|
SetWorld ( |
||
|
UpdateOptionalPropertyVisibility() |
Call this function to update optional property sets visibility. Should call base implementation |
|
|
UpdateResult() |
Name | Description | ||
---|---|---|---|
|
CanAccept() |
||
|
HasAccept() |
||
|
HasCancel() |
||
|
OnTick ( |
Action support/system |
|
|
Render ( |
Allow the Tool to do any custom drawing (ie via PDI/RHI) |
|
|
Setup() |
InteractiveTool API - generally does not need to be modified by subclasses |
|
|
Shutdown ( |
Called by ToolManager to shut down the Tool |
Name | Description | ||
---|---|---|---|
|
TUniquePtr< ... |
MakeNewOperator() |
UBaseMeshProcessingTool REQUIRED API - subclasses must implement these functions IDynamicMeshOperatorFactory implementation that subclass must override and implement |
Name |
Description |
|
---|---|---|
|
FOptionalPropertySet |