Open 3D Engine EMotionFX Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::AnimGraphInstance Class Reference

#include <AnimGraphInstance.h>

Inherits MCore::RefCounted.

Classes

struct  InitSettings
 

Public Types

enum  {
  OBJECTFLAGS_OUTPUT_READY = 1 << 0 , OBJECTFLAGS_UPDATE_READY = 1 << 1 , OBJECTFLAGS_TOPDOWNUPDATE_READY = 1 << 2 , OBJECTFLAGS_POSTUPDATE_READY = 1 << 3 ,
  OBJECTFLAGS_SYNCED = 1 << 4 , OBJECTFLAGS_RESYNC = 1 << 5 , OBJECTFLAGS_SYNCINDEX_CHANGED = 1 << 6 , OBJECTFLAGS_PLAYMODE_BACKWARD = 1 << 7 ,
  OBJECTFLAGS_IS_SYNCLEADER = 1 << 8
}
 

Public Member Functions

void Output (Pose *outputPose)
 
void Start ()
 
void Stop ()
 
MCORE_INLINE ActorInstanceGetActorInstance () const
 
MCORE_INLINE AnimGraphGetAnimGraph () const
 
MCORE_INLINE MotionSetGetMotionSet () const
 
void SetParentAnimGraphInstance (AnimGraphInstance *parentAnimGraphInstance)
 
MCORE_INLINE AnimGraphInstanceGetParentAnimGraphInstance () const
 
void RemoveChildAnimGraphInstance (AnimGraphInstance *childAnimGraphInstance)
 
bool GetParameterValueAsFloat (const char *paramName, float *outValue)
 
bool GetParameterValueAsBool (const char *paramName, bool *outValue)
 
bool GetParameterValueAsInt (const char *paramName, int32 *outValue)
 
bool GetVector2ParameterValue (const char *paramName, AZ::Vector2 *outValue)
 
bool GetVector3ParameterValue (const char *paramName, AZ::Vector3 *outValue)
 
bool GetVector4ParameterValue (const char *paramName, AZ::Vector4 *outValue)
 
bool GetRotationParameterValue (const char *paramName, AZ::Quaternion *outRotation)
 
bool GetParameterValueAsFloat (size_t paramIndex, float *outValue)
 
bool GetParameterValueAsBool (size_t paramIndex, bool *outValue)
 
bool GetParameterValueAsInt (size_t paramIndex, int32 *outValue)
 
bool GetVector2ParameterValue (size_t paramIndex, AZ::Vector2 *outValue)
 
bool GetVector3ParameterValue (size_t paramIndex, AZ::Vector3 *outValue)
 
bool GetVector4ParameterValue (size_t paramIndex, AZ::Vector4 *outValue)
 
bool GetRotationParameterValue (size_t paramIndex, AZ::Quaternion *outRotation)
 
void SetMotionSet (MotionSet *motionSet)
 
void CreateParameterValues ()
 
void AddMissingParameterValues ()
 
void ReInitParameterValue (size_t index)
 
void ReInitParameterValues ()
 
void RemoveParameterValue (size_t index, bool delFromMem=true)
 
void AddParameterValue ()
 
void InsertParameterValue (size_t index)
 
void MoveParameterValue (size_t oldIndex, size_t newIndex)
 
void RemoveAllParameters (bool delFromMem)
 
template<typename T >
MCORE_INLINE T * GetParameterValueChecked (size_t index) const
 
MCORE_INLINE MCore::AttributeGetParameterValue (size_t index) const
 
MCore::AttributeFindParameter (const AZStd::string &name) const
 
AZ::Outcome< size_t > FindParameterIndex (const AZStd::string &name) const
 
bool SwitchToState (const char *stateName)
 
bool TransitionToState (const char *stateName)
 
void ResetUniqueDatas ()
 
void RecursiveInvalidateUniqueDatas ()
 
size_t CalcNumAllocatedUniqueDatas () const
 
void ApplyMotionExtraction ()
 
void RecursiveResetFlags (uint32 flagsToDisable)
 
void ResetFlagsForAllObjects (uint32 flagsToDisable)
 
void ResetFlagsForAllNodes (uint32 flagsToDisable)
 
void ResetFlagsForAllObjects ()
 
void ResetPoseRefCountsForAllNodes ()
 
void ResetRefDataRefCountsForAllNodes ()
 
AnimGraphObjectDataFindOrCreateUniqueObjectData (const AnimGraphObject *object)
 
AnimGraphNodeDataFindOrCreateUniqueNodeData (const AnimGraphNode *node)
 
void AddUniqueObjectData ()
 
AnimGraphObjectDataGetUniqueObjectData (size_t index)
 
size_t GetNumUniqueObjectDatas () const
 
void RemoveUniqueObjectData (size_t index, bool delFromMem)
 
void RemoveUniqueObjectData (AnimGraphObjectData *uniqueData, bool delFromMem)
 
void RemoveAllObjectData (bool delFromMem)
 
void Update (float timePassedInSeconds)
 
void OutputEvents ()
 
void SetAutoUnregisterEnabled (bool enabled)
 
bool GetAutoUnregisterEnabled () const
 
void SetIsOwnedByRuntime (bool isOwnedByRuntime)
 
bool GetIsOwnedByRuntime () const
 
ActorInstanceFindActorInstanceFromParentDepth (size_t parentDepth) const
 
void SetVisualizeScale (float scale)
 
float GetVisualizeScale () const
 
void SetVisualizationEnabled (bool enabled)
 
bool GetVisualizationEnabled () const
 
bool GetRetargetingEnabled () const
 
void SetRetargetingEnabled (bool enabled)
 
AnimGraphNodeGetRootNode () const
 
void AddEventHandler (AnimGraphInstanceEventHandler *eventHandler)
 
void RemoveEventHandler (AnimGraphInstanceEventHandler *eventHandler)
 
void RemoveAllEventHandlers ()
 
void OnStateEnter (AnimGraphNode *state)
 
void OnStateEntering (AnimGraphNode *state)
 
void OnStateExit (AnimGraphNode *state)
 
void OnStateEnd (AnimGraphNode *state)
 
void OnStartTransition (AnimGraphStateTransition *transition)
 
void OnEndTransition (AnimGraphStateTransition *transition)
 
void CollectActiveAnimGraphNodes (AZStd::vector< AnimGraphNode * > *outNodes, const AZ::TypeId &nodeType=AZ::TypeId::CreateNull())
 
void CollectActiveNetTimeSyncNodes (AZStd::vector< AnimGraphNode * > *outNodes)
 
MCORE_INLINE uint32 GetObjectFlags (size_t objectIndex) const
 
MCORE_INLINE void SetObjectFlags (size_t objectIndex, uint32 flags)
 
MCORE_INLINE void EnableObjectFlags (size_t objectIndex, uint32 flagsToEnable)
 
MCORE_INLINE void DisableObjectFlags (size_t objectIndex, uint32 flagsToDisable)
 
MCORE_INLINE void SetObjectFlags (size_t objectIndex, uint32 flags, bool enabled)
 
MCORE_INLINE bool GetIsObjectFlagEnabled (size_t objectIndex, uint32 flag) const
 
MCORE_INLINE bool GetIsOutputReady (size_t objectIndex) const
 
MCORE_INLINE void SetIsOutputReady (size_t objectIndex, bool isReady)
 
MCORE_INLINE bool GetIsSynced (size_t objectIndex) const
 
MCORE_INLINE void SetIsSynced (size_t objectIndex, bool isSynced)
 
MCORE_INLINE bool GetIsResynced (size_t objectIndex) const
 
MCORE_INLINE void SetIsResynced (size_t objectIndex, bool isResynced)
 
MCORE_INLINE bool GetIsUpdateReady (size_t objectIndex) const
 
MCORE_INLINE void SetIsUpdateReady (size_t objectIndex, bool isReady)
 
MCORE_INLINE bool GetIsTopDownUpdateReady (size_t objectIndex) const
 
MCORE_INLINE void SetIsTopDownUpdateReady (size_t objectIndex, bool isReady)
 
MCORE_INLINE bool GetIsPostUpdateReady (size_t objectIndex) const
 
MCORE_INLINE void SetIsPostUpdateReady (size_t objectIndex, bool isReady)
 
const InitSettingsGetInitSettings () const
 
const AnimGraphEventBufferGetEventBuffer () const
 
void AddFollowerGraph (AnimGraphInstance *follower, bool registerLeaderInsideFollower)
 
void RemoveFollowerGraph (AnimGraphInstance *follower, bool removeLeaderFromFollower)
 
AZStd::vector< AnimGraphInstance * > & GetFollowerGraphs ()
 
void CreateSnapshot (bool authoritative)
 
void SetSnapshotSerializer (AZStd::shared_ptr< Network::AnimGraphSnapshotSerializer > serializer)
 
void SetSnapshotChunkSerializer (AZStd::shared_ptr< Network::AnimGraphSnapshotChunkSerializer > serializer)
 
const AZStd::shared_ptr< AnimGraphSnapshotGetSnapshot () const
 
bool IsNetworkEnabled () const
 
MCore::LcgRandomGetLcgRandom ()
 
void OnNetworkConnected ()
 
void OnNetworkParamUpdate (const AttributeContainer &parameters)
 
void OnNetworkActiveNodesUpdate (const AZStd::vector< AZ::u32 > &activeNodes)
 
void OnNetworkMotionNodePlaytimesUpdate (const MotionNodePlaytimeContainer &motionNodePlaytimes)
 
void SetAutoReleaseRefDatas (bool automaticallyFreeRefDatas)
 
void SetAutoReleasePoses (bool automaticallyFreePoses)
 
void ReleaseRefDatas ()
 
void ReleasePoses ()
 
- Public Member Functions inherited from MCore::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static AnimGraphInstanceCreate (AnimGraph *animGraph, ActorInstance *actorInstance, MotionSet *motionSet, const InitSettings *initSettings=nullptr)
 

Additional Inherited Members

- Protected Member Functions inherited from MCore::RefCounted
virtual void Delete ()
 

Detailed Description

The anim graph instance class.

Member Function Documentation

◆ AddEventHandler()

void EMotionFX::AnimGraphInstance::AddEventHandler ( AnimGraphInstanceEventHandler eventHandler)

Add event handler to the anim graph instance.

Parameters
eventHandlerThe new event handler to register, this must not be nullptr.

◆ CalcNumAllocatedUniqueDatas()

size_t EMotionFX::AnimGraphInstance::CalcNumAllocatedUniqueDatas ( ) const

Get the number of currently allocated unique datas. Due to deferred initialization, unique datas of the anim graph objects are allocated when needed at runtime. The number of allocated unique datas will equal GetNumUniqueObjectDatas() after all objects were activated.

Returns
The number of currently allocated unique datas.

◆ GetAutoUnregisterEnabled()

bool EMotionFX::AnimGraphInstance::GetAutoUnregisterEnabled ( ) const

Check if the anim graph instance is automatically being unregistered from the anim graph manager when this anim graph instance gets deleted or not.

Returns
Returns true when it will get automatically deleted, otherwise false is returned.

◆ RemoveAllEventHandlers()

void EMotionFX::AnimGraphInstance::RemoveAllEventHandlers ( )

Remove all event handlers.

◆ RemoveEventHandler()

void EMotionFX::AnimGraphInstance::RemoveEventHandler ( AnimGraphInstanceEventHandler eventHandler)

Remove the given event handler.

Parameters
eventHandlerA pointer to the event handler to remove.

◆ SetAutoUnregisterEnabled()

void EMotionFX::AnimGraphInstance::SetAutoUnregisterEnabled ( bool  enabled)

Set if we want to automatically unregister the anim graph instance from the anim graph manager when we delete the anim graph instance. On default this is set to true.

Parameters
enabledSet to true when you wish to automatically have the anim graph instance unregistered, otherwise set it to false.

◆ SetIsOwnedByRuntime()

void EMotionFX::AnimGraphInstance::SetIsOwnedByRuntime ( bool  isOwnedByRuntime)

Marks the actor as used by the engine runtime, as opposed to the tool suite.


The documentation for this class was generated from the following file: