Navigation
API > API/Plugins > API/Plugins/AnimNext > API/Plugins/AnimNext/TraitCore
Inheritance Hierarchy
References
| Module | AnimNext |
| Header | /Engine/Plugins/Experimental/AnimNext/Source/AnimNext/Public/TraitCore/Trait.h |
| Include | #include "TraitCore/Trait.h" |
Syntax
struct FTrait
Remarks
Base class for all traits. A trait can implement any number of interfaces based on ITraitInterface. A trait may derive from another trait. A trait should implement GetInterface(..) and test against the interfaces that it supports.
Traits should NOT have any internal state, hence why all API functions are 'const'. The reason for this is that at runtime, a single instance of every trait exists. That single instance is used by all instances of a trait on a node and concurrently on all worker threads.
Traits can have shared read-only data that all instances of a graph can use (e.g. hard-coded properties). Shared data must derive from FAnimNextTraitSharedData. Traits can have instance data (e.g. blend weight). Instance data must derive from FTraitInstanceData.
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FTrait () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TArray< FTraitEventUID > | BuildTraitEventList
(
const TConstArrayView< FTraitEventUID >& SuperEvents, |
Builds a list of events with the provided super events and current events as an initializer list. | |
| TArray< FTraitInterfaceUID > | BuildTraitInterfaceList
(
const TConstArrayView< FTraitInterfaceUID >& SuperInterfaces, |
Builds a list of interfaces with the provided super interfaces and current interfaces as an initializer list. | |
| void | ConstructTraitInstance
(
const FExecutionContext& Context, |
Called when a new instance of the trait is created or destroyed Derived types must override this and forward to the instance data constructor/destructor | |
| void | DestructTraitInstance
(
const FExecutionContext& Context, |
||
| TArray< FLatentPropertyMetadata > | GetLatentPropertyHandles
(
bool bFilterEditorOnly, |
Takes the editor properties as authored in the graph and returns the latent property metadata using UE reflection. | |
| FTraitLatentPropertyMemoryLayout | GetLatentPropertyMemoryLayout
(
FName PropertyName, |
Returns the memory layout of the specified latent property. | |
| FTraitLatentPropertyMemoryLayout | GetLatentPropertyMemoryLayoutImpl
(
FName PropertyName, |
Implements GetLatentPropertyMemoryLayout() by allowing a map to be provided for caching purposes to speed up repeated queries. | |
| uint32 | The number of latent property properties in the shared data of this trait. | ||
| TConstArrayView< FTraitEventUID > | Returns a list of events that this trait handles. | ||
| const ITraitInterface * | GetTraitInterface
(
FTraitInterfaceUID InterfaceUID |
Returns a pointer to the specified interface if it is supported. Derived types must override this. | |
| TConstArrayView< FTraitInterfaceUID > | Returns a list of interfaces that this trait supports. | ||
| FTraitMemoryLayout | Returns the memory requirements of the derived trait instance. | ||
| ETraitMode | GetTraitMode () |
Returns the trait mode. | |
| FString | GetTraitName () |
Returns the trait name. | |
| TConstArrayView< FTraitInterfaceUID > | Returns a list of interfaces that this trait reqquires. | ||
| UScriptStruct * | Returns the UScriptStruct associated with the shared data for the trait. | ||
| FTraitUID | GetTraitUID () |
Returns the globally unique UID for this trait. | |
| bool | IsHidden () |
Makes the Trait Editor only display this Trait in Advanced view. | |
| ETraitStackPropagation | OnTraitEvent
(
FExecutionContext& Context, |
Called when an event reaches an instance of this trait. | |
| void | SaveTraitSharedData
(
const TFunction< FString(FName PropertyName)>& GetTraitProperty, |
Takes the editor properties as authored in the graph and converts them into an instance of the FAnimNextTraitSharedData derived type using UE reflection. | |
| void | SerializeTraitSharedData
(
FArchive& Ar, |
Called to serialize trait shared data. |
Typedefs
| Name | Description |
|---|---|
| FInstanceData | |
| FSharedData | Empty shared/instance data types Derived types must define an alias for these |
Constants
| Name | Description |
|---|---|
| TraitUID | The globally unique UID for this trait Derived types will have their own TraitUID member that hides/aliases/shadows this one |