Navigation
API > API/Plugins > API/Plugins/UAFAnimGraph
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.
| Name | FTrait |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/UAF/UAFAnimGraph/Source/UAFAnimGraph/Public/TraitCore/Trait.h |
| Include Path | #include "TraitCore/Trait.h" |
Syntax
struct FTrait
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FTrait() |
TraitCore/Trait.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FInstanceData | FTraitInstanceData | TraitCore/Trait.h | |
| FSharedData | FAnimNextTraitSharedData | Empty shared/instance data types Derived types must define an alias for these | TraitCore/Trait.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| TraitUID | FTraitUID | The globally unique UID for this trait Derived types will have their own TraitUID member that hides/aliases/shadows this one | TraitCore/Trait.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
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 | TraitCore/Trait.h | |
void DestructTraitInstance
(
const FExecutionContext& Context, |
TraitCore/Trait.h | ||
virtual uint32 GetLatentPropertyHandles
(
const FAnimNextTraitSharedData* InSharedData, |
Takes the trait shared data and the editor properties as authored in the graph and generates the latent property metadata using UE reflection. | TraitCore/Trait.h | |
virtual int32 GetLatentPropertyIndex
(
const FAnimNextTraitSharedData& InSharedData, |
Returns the latent property index or INDEX_NONE if the property isn't found or if it isn't latent WARNING: Latent property handles are in the order defined by the enumerator macro within the shared data, | TraitCore/Trait.h | |
virtual FTraitLatentPropertyMemoryLayout GetLatentPropertyMemoryLayout
(
const FAnimNextTraitSharedData& SharedData, |
Returns the memory layout of the specified latent property. | TraitCore/Trait.h | |
virtual uint32 GetNumLatentTraitProperties() |
The number of latent property properties in the shared data of this trait. | TraitCore/Trait.h | |
virtual void GetProgrammaticPins
(
FAnimNextTraitSharedData* InSharedData, |
Enable Traits to generate TraitStack pins. | TraitCore/Trait.h | |
virtual TConstArrayView< FTraitEventUID > GetTraitEvents() |
Returns a list of events that this trait handles. | TraitCore/Trait.h | |
virtual const ITraitInterface * GetTraitInterface
(
FTraitInterfaceUID InterfaceUID |
Returns a pointer to the specified interface if it is supported. Derived types must override this. | TraitCore/Trait.h | |
virtual TConstArrayView< FTraitInterfaceUID > GetTraitInterfaces() |
Returns a list of interfaces that this trait supports. | TraitCore/Trait.h | |
FTraitMemoryLayout GetTraitMemoryDescription() |
Returns the memory requirements of the derived trait instance. | TraitCore/Trait.h | |
ETraitMode GetTraitMode() |
Returns the trait mode. | TraitCore/Trait.h | |
virtual FString GetTraitName() |
Returns the trait name. | TraitCore/Trait.h | |
virtual TConstArrayView< FTraitInterfaceUID > GetTraitRequiredInterfaces() |
Returns a list of interfaces that this trait reqquires. | TraitCore/Trait.h | |
virtual UScriptStruct * GetTraitSharedDataStruct() |
Returns the UScriptStruct associated with the shared data for the trait. | TraitCore/Trait.h | |
virtual FTraitUID GetTraitUID() |
Returns the globally unique UID for this trait. | TraitCore/Trait.h | |
uint32 GetVariableMappedLatentPropertyHandles
(
const FAnimNextTraitSharedData* InSharedData, |
Takes the trait shared data and the editor properties as authored in the graph and generates the latent property metadata using UE reflection. | TraitCore/Trait.h | |
virtual bool IsHidden() |
Makes the Trait Editor only display this Trait in Advanced view. | TraitCore/Trait.h | |
bool IsPropertyLatent
(
const FAnimNextTraitSharedData& InSharedData, |
Returns whether or not the specified property has been marked as latent. | TraitCore/Trait.h | |
virtual bool MultipleInstanceSupport() |
Whether or not this trait can be placed multiple times on a trait stack. | TraitCore/Trait.h | |
virtual ETraitStackPropagation OnTraitEvent
(
FExecutionContext& Context, |
Called when an event reaches an instance of this trait. | TraitCore/Trait.h | |
virtual void SaveTraitSharedData
(
const TFunction< FString(FNamePropertyName)>& GetTraitProperty, |
Takes the editor properties as authored in the graph and converts them into an instance of the FAnimNextTraitSharedData derived type using UE reflection. | TraitCore/Trait.h | |
virtual void SerializeTraitSharedData
(
FArchive& Ar, |
Called to serialize trait shared data. | TraitCore/Trait.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTraitLatentPropertyMemoryLayout GetLatentPropertyMemoryLayoutImpl
(
const FAnimNextTraitSharedData& SharedData, |
Implements GetLatentPropertyMemoryLayout() by allowing a map to be provided for caching purposes to speed up repeated queries. | TraitCore/Trait.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TArray< FTraitEventUID > BuildTraitEventList
(
const TConstArrayView< FTraitEventUID >& SuperEvents, |
Builds a list of events with the provided super events and current events as an initializer list. | TraitCore/Trait.h | |
static TArray< FTraitInterfaceUID > BuildTraitInterfaceList
(
const TConstArrayView< FTraitInterfaceUID >& SuperInterfaces, |
Builds a list of interfaces with the provided super interfaces and current interfaces as an initializer list. | TraitCore/Trait.h |