| FNonAbandonableTask
|
Module |
|
Header |
/Engine/Plugins/Experimental/MeshModelingToolset/Source/MeshModelingTools/Public/DeformMeshPolygonsTool.h |
Include |
#include "DeformMeshPolygonsTool.h" |
class FConstrainedMeshDeformerTask : public FNonAbandonableTask
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
Name | Description | |
---|---|---|
|
FConstrainedMeshDeformerTask ( |
Name | Description | |
---|---|---|
|
~FConstrainedMeshDeformerTask() |
Name | Description | ||
---|---|---|---|
|
DoWork() |
Called by the FAsyncTask |
|
|
ExportResults ( |
Updates the positions in the target mesh for regions that correspond to the subset mesh |
|
|
GetStatId() |
NO idea what this is meant to do. Performance analysis maybe? Scheduling data? |
|
|
SetAbortSource ( |
Required by the FAsyncTaskExecutor |
|
|
UpdateDeformer ( |
Called by the main thread in the tool, this copies the Constraint buffer right before the task begins on another thread. |
Name |
Description |
---|---|
INACTIVE_SUBSET_ID |