Navigation
API > API/Plugins > API/Plugins/MLDeformerFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UMLDeformerModelInstance
- UMLDeformerMorphModelInstance
- UNearestNeighborModelInstance
- UNeuralMorphModelInstance
- UVertexDeltaModelInstance
References
| Module | MLDeformerFramework |
| Header | /Engine/Plugins/Animation/MLDeformer/MLDeformerFramework/Source/MLDeformerFramework/Public/MLDeformerModelInstance.h |
| Include | #include "MLDeformerModelInstance.h" |
Syntax
UCLASS ()
class UMLDeformerModelInstance : public UObject
Remarks
An instance of the ML Deformer model. The ML Deformer model contains shared data, while this instance contains data unique to the actor it is being applied to. So if you have 1 ML Deformer model, applied to 100 enemy actors, you will get 100 ML Deformer Model Instance objects. The model instance is created and managed by the ML Deformer component. The main task of the model instance is to feed the neural network with the right input values and run the neural network inference at runtime, and possibly do something with the output.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< int32 > | AssetBonesToSkelMeshMappings | Maps the ML deformer asset bone index to a skeletal mesh component bone index. | |
| bool | bHasPostInitialized | Has this instance had a successful UMLDeformerModel::PostMLDeformerComponentInit call? | |
| bool | bIsCompatible | Are the deformer asset and the used skeletal mesh component compatible? | |
| TArray< FTransform > | DebugBoneSpaceTransforms | The debug bone space transforms. | |
| FString | ErrorText | The compatibility error text, in case bIsCompatible is false. | |
| TObjectPtr< UMLDeformerModel > | Model | The ML Deformer model that this is an instance of. | |
| FRenderCommandFence | RenderCommandFence | The fence that let's us wait for all render commands to finish, before we continue. | |
| TObjectPtr< USkeletalMeshComponent > | SkeletalMeshComponent | The skeletal mesh component we work with. This is mainly used for compatibility checks. | |
| TArray< FTransform > | TrainingBoneTransforms | The cached current local space bone transforms for the current frame. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| FString | CheckCompatibility
(
USkeletalMeshComponent* InSkelMeshComponent, |
Check whether the deformer is compatible with a given skeletal mesh component. | |
| void | Copy over data from the debug actor, if any is used. | ||
| void | CopyDataFromDebugActor
(
const AActor* DebugActor, |
Copy data from a specific debug actor. | |
| void | Execute
(
float ModelWeight |
Execute the model instance, which can run the neural network inference in case the model uses a neural network. | |
| const FString & | Get the compatibility error text. | ||
| USkeletalMeshComponent * | Get the skeletal mesh component to get transforms from etc. | ||
| UMLDeformerComponent * | Get the ML Deformer component that this instance is part of. | ||
| UMLDeformerModel * | GetModel () |
Get the model that this is an instance of. | |
| int32 | Get the neural network inference handle. | ||
| USkeletalMeshComponent * | Get the skeletal mesh component we're working with. | ||
| void | Handle when the model weight is zero. | ||
| bool | Check whether we already called UMLDeformerModel::PostMLDeformerComponentInit. | ||
| bool | Check whether we have valid transforms in the skeletal mesh component. | ||
| void | Init
(
USkeletalMeshComponent* SkelMeshComponent |
Initialize the model instance. | |
| bool | IsCompatible () |
Is the deformer asset used compatible with the skeletal mesh component used during the Init call? | |
| bool | Check if we are in a valid state for the deformer graph's data provider. | ||
| void | Initialize this model, after the ML deformer component has been initialized. | ||
| void | PostTick
(
bool bExecuteCalled |
Executed at the end of the tick. | |
| void | Release () |
Release all built lookup tables etc. Also call this base class method if you override this method. | |
| int64 | SetBoneTransforms
(
float* OutputBuffer, |
Set the bone transformations inside a given output buffer, starting from a given StartIndex. | |
| int64 | SetCurveValues
(
float* OutputBuffer, |
Set the animation curve values inside a given output buffer, starting from a given StartIndex. | |
| void | SetHasPostInitialized
(
bool bHasInitialized |
Set whether we had a successful call to UMLDeformerModel::PostMLDeformerComponentInit. | |
| void | SetModel
(
UMLDeformerModel* InModel |
Set the deformer model that this is an instance of. | |
| int64 | SetNeuralNetworkInputValues
(
float* InputData, |
Update the neural network input values directly inside its input tensor. | |
| bool | SetupInputs () |
Setup the neural network for this frame. | |
| void | Tick
(
float DeltaTime, |
Update the deformer instance. | |
| void | Updates the bone transforms array. | ||
| void | Update the compatibility status, as returned by IsCompatible() and GetCompatibilityErrorText(). |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | BeginDestroy () |
Called before destroying the object. | |
| bool | Called to check if the object is ready for FinishDestroy. |