FConstrainedMeshDeformerTask

FDeformTask is an object which wraps an asynchronous task to be run multiple times on a separate thread.

Windows
MacOS
Linux

Inheritance Hierarchy

FNonAbandonableTask

FConstrainedMeshDeformerTask

References

Module

MeshModelingTools

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/MeshModelingTools/Public/DeformMeshPolygonsTool.h

Include

#include "DeformMeshPolygonsTool.h"

Syntax

class FConstrainedMeshDeformerTask : public FNonAbandonableTask

Remarks

FDeformTask is an object which wraps an asynchronous task to be run multiple times on a separate thread. The Laplacian deformation process requires the use of potentially large sparse matrices and sparse multiplication.

Expected usage:

// define constraints. Need Constraints[VertID] to hold the constraints for the corresponding vertex. TArray<FDeformerVertexConstraintData> Constraints; ....

// populate with the VertexIDs of the vertices that are in the region you wish to deform. TArray<int32> SrcVertIDs; //Basically a mini-index buffer. ...

// Create or reuse a laplacian deformation task. FDeformTask* DeformTask = New FDeformTask(WeightScheme);

// the deformer will have to build a new mesh that represents the regions in SrcVertIDs; // but set this to false on subsequent calls to UpdateDeformer if the SrcVertIDs array hasn't changed. bool bRequiresRegion = true;

DefTask->UpdateDeformer(WeightScheme, Mesh, Constraints, SrcVertIDs, bRequiresRegion);

DeformTask->DoWork(); or DeformTask->StartBackgroundTask(); //which calls DoWork on background thread.

// wheh DeformTask->IsDone == true; you can copy the results back to the mesh DeformTask->ExportResults(Mesh);

Note: if only the positions in the Constraints change (e.g. handle positions) then subsequent calls to UpdateDeformer() and DoWork() will be much faster as the matrix system will not be rebuilt or re-factored

Constructors

Name Description

Public function

FConstrainedMeshDeformerTask

(
    const ELaplacianWeightScheme Select...
)

Destructors

Functions

Name Description

Public function

void

 

DoWork()

Called by the FAsyncTask object for background computation.

Public function Const

void

 

ExportResults

(
    FDynamicMesh3& TargetMesh
)

Updates the positions in the target mesh for regions that correspond to the subset mesh

Public function Const

TStatId

 

GetStatId()

NO idea what this is meant to do. Performance analysis maybe? Scheduling data?

Public function

void

 

SetAbortSource

(
    bool* bAbort
)

Required by the FAsyncTaskExecutor

Public function

void

 

UpdateDeformer

(
    const ELaplacianWeightScheme Select...,
    const FDynamicMesh3& Mesh,
    const TArray< FDeformerVertexConstr...,
    const TArray< int32 >& SrcIDBuffer...,
    bool bNewTransaction,
    const FRichCurve* Curve
)

Called by the main thread in the tool, this copies the Constraint buffer right before the task begins on another thread.

Constants

Name

Description

INACTIVE_SUBSET_ID

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