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

Inherits EMotionFX::BaseObject.

Public Member Functions

void AddMotion (Motion *motion)
 
MCORE_INLINE MotionGetMotion (size_t index) const
 
MCORE_INLINE size_t GetNumMotions () const
 
bool RemoveMotionByName (const char *motionName, bool delFromMemory=true, bool isTool=true)
 
bool RemoveMotionByID (uint32 id, bool delFromMemory=true)
 
bool RemoveMotionByFileName (const char *fileName, bool delFromMemory=true, bool isTool=true)
 
bool RemoveMotion (Motion *motion, bool delFromMemory=true)
 
MotionFindMotionByName (const char *motionName, bool isTool=true) const
 
MotionFindMotionByFileName (const char *fileName, bool isTool=true) const
 
MotionFindMotionByID (uint32 id) const
 
size_t FindMotionIndexByName (const char *motionName, bool isTool=true) const
 
size_t FindMotionIndexByFileName (const char *fileName, bool isTool=true) const
 
size_t FindMotionIndexByID (uint32 id) const
 
size_t FindMotionIndex (Motion *motion) const
 
void AddMotionSet (MotionSet *motionSet)
 
MCORE_INLINE MotionSetGetMotionSet (size_t index) const
 
MCORE_INLINE size_t GetNumMotionSets () const
 
size_t CalcNumRootMotionSets () const
 
MotionSetFindRootMotionSet (size_t index)
 
MotionSetFindMotionSetByName (const char *name, bool isOwnedByRuntime=false) const
 
MotionSetFindMotionSetByID (uint32 id) const
 
MotionSetFindMotionSetByFileName (const char *fileName, bool isTool=true) const
 
size_t FindMotionSetIndexByName (const char *name, bool isTool=true) const
 
size_t FindMotionSetIndexByID (uint32 id) const
 
size_t FindMotionSetIndex (MotionSet *motionSet) const
 
bool RemoveMotionSetByName (const char *motionName, bool delFromMemory=true, bool isTool=true)
 
bool RemoveMotionSetByID (uint32 id, bool delFromMemory=true)
 
bool RemoveMotionSet (MotionSet *motionSet, bool delFromMemory=true)
 
void Clear (bool delFromMemory=true)
 
void Lock ()
 
void Unlock ()
 
MotionDataFactoryGetMotionDataFactory ()
 
const MotionDataFactoryGetMotionDataFactory () const
 
- Public Member Functions inherited from EMotionFX::BaseObject
 BaseObject ()
 
virtual ~BaseObject ()
 
- Public Member Functions inherited from MCore::MemoryObject
 MemoryObject ()
 
virtual ~MemoryObject ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static MotionManagerCreate ()
 

Friends

class Initializer
 
class EMotionFXManager
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 

Member Function Documentation

◆ AddMotion()

void EMotionFX::MotionManager::AddMotion ( Motion motion)

Add a motion to the motion manager.

◆ AddMotionSet()

void EMotionFX::MotionManager::AddMotionSet ( MotionSet motionSet)

Add a motion set to the motion manager.

Parameters
[in]motionSetA pointer to the motion set to add.

◆ CalcNumRootMotionSets()

size_t EMotionFX::MotionManager::CalcNumRootMotionSets ( ) const

Calculate the number of root motion sets. This will iterate over all motion sets, check if they have a parent and sum all the root ones.

Returns
The number of root motion sets.

◆ FindMotionByFileName()

Motion * EMotionFX::MotionManager::FindMotionByFileName ( const char *  fileName,
bool  isTool = true 
) const

Find the given motion by filename.

Parameters
[in]fileNameThe filename of the motion.
[in]isToolSet when calling this function from the tools environment (default).
Returns
A pointer to the motion with the given filename. nullptr in case the motion has not been found.

◆ FindMotionByID()

Motion * EMotionFX::MotionManager::FindMotionByID ( uint32  id) const

Find the given motion by name.

Parameters
[in]idThe id of the motion.
Returns
A pointer to the motion with the given id. nullptr in case the motion has not been found.

◆ FindMotionByName()

Motion * EMotionFX::MotionManager::FindMotionByName ( const char *  motionName,
bool  isTool = true 
) const

Find the given motion by name.

Parameters
[in]motionNameThe name of the motion.
[in]isToolSet when calling this function from the tools environment (default).
Returns
A pointer to the motion with the given name. nullptr in case the motion has not been found.

◆ FindMotionIndex()

size_t EMotionFX::MotionManager::FindMotionIndex ( Motion motion) const

Find the index for the given motion.

Parameters
[in]motionA pointer to the motion to search.
Returns
The index of the motion. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionIndexByFileName()

size_t EMotionFX::MotionManager::FindMotionIndexByFileName ( const char *  fileName,
bool  isTool = true 
) const

Find the motion index by file name.

Parameters
[in]fileNameThe file name of the motion.
[in]isToolSet when calling this function from the tools environment (default).
Returns
The index of the motion with the given name. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionIndexByID()

size_t EMotionFX::MotionManager::FindMotionIndexByID ( uint32  id) const

Find the motion index by id.

Parameters
[in]idThe id of the motion.
Returns
The index of the motion with the given id. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionIndexByName()

size_t EMotionFX::MotionManager::FindMotionIndexByName ( const char *  motionName,
bool  isTool = true 
) const

Find the motion index by name.

Parameters
[in]motionNameThe name of the motion.
[in]isToolSet when calling this function from the tools environment (default).
Returns
The index of the motion with the given name. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionSetByFileName()

MotionSet * EMotionFX::MotionManager::FindMotionSetByFileName ( const char *  fileName,
bool  isTool = true 
) const

Find motion set by its filename.

Parameters
[in]fileNameThe filename of the motion set to search for.
[in]isToolSet when calling this function from the tools environment (default).
Returns
A pointer to the motion set with the given id. nullptr in case the motion set has not been found.

◆ FindMotionSetByID()

MotionSet * EMotionFX::MotionManager::FindMotionSetByID ( uint32  id) const

Find motion set by id.

Parameters
[in]idThe id of the motion set.
Returns
A pointer to the motion set with the given id. nullptr in case the motion set has not been found.

◆ FindMotionSetByName()

MotionSet * EMotionFX::MotionManager::FindMotionSetByName ( const char *  name,
bool  isOwnedByRuntime = false 
) const

Find motion set by name.

Parameters
[in]nameThe name of the motion set.
[in]isOwnedByRuntimeSet when calling this function from Ly environment (default false to mean called from EMotionStudio).
Returns
A pointer to the motion set with the given name. nullptr in case the motion set has not been found.

◆ FindMotionSetIndex()

size_t EMotionFX::MotionManager::FindMotionSetIndex ( MotionSet motionSet) const

Find motion set index for the given motion set.

Parameters
[in]motionSetA pointer to the motion set to search.
Returns
The index for the given motion set. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionSetIndexByID()

size_t EMotionFX::MotionManager::FindMotionSetIndexByID ( uint32  id) const

Find motion set index by id.

Parameters
[in]idThe id of the motion set.
Returns
The index of the motion set with the given id. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindMotionSetIndexByName()

size_t EMotionFX::MotionManager::FindMotionSetIndexByName ( const char *  name,
bool  isTool = true 
) const

Find motion set index by name.

Parameters
[in]nameThe name of the motion set.
[in]isToolSet when calling this function from the tools environment (default).
Returns
The index of the motion set with the given name. MCORE_INVALIDINDEX32 in case the motion has not been found.

◆ FindRootMotionSet()

MotionSet * EMotionFX::MotionManager::FindRootMotionSet ( size_t  index)

Find the root motion set with the given index.

Parameters
[in]indexThe index of the root motion set. The index must be in range [0, CalcNumRootMotionSets()-1].
Returns
A pointer to the given motion set.

◆ GetMotion()

MCORE_INLINE Motion * EMotionFX::MotionManager::GetMotion ( size_t  index) const
inline

Get a pointer to the given motion.

Parameters
[in]indexThe index of the motion. The index must be in range [0, GetNumMotions()-1].
Returns
A pointer to the given motion set.

◆ GetMotionSet()

MCORE_INLINE MotionSet * EMotionFX::MotionManager::GetMotionSet ( size_t  index) const
inline

Get a pointer to the given motion set.

Parameters
[in]indexThe index of the motion set. The index must be in range [0, GetNumMotionSets()-1].
Returns
A pointer to the given motion set.

◆ GetNumMotions()

MCORE_INLINE size_t EMotionFX::MotionManager::GetNumMotions ( ) const
inline

Get the number of motions in the motion manager.

Returns
The number of registered motions.

◆ GetNumMotionSets()

MCORE_INLINE size_t EMotionFX::MotionManager::GetNumMotionSets ( ) const
inline

Get the number of motion sets in the motion manager.

Returns
The number of registered motion sets.

◆ RemoveMotion()

bool EMotionFX::MotionManager::RemoveMotion ( Motion motion,
bool  delFromMemory = true 
)

Remove the given motion from the motion manager.

Parameters
[in]motionA pointer to the motion to remove.
delFromMemorySet this to true when if you also want to delete the motion from memory. When set to false, it will not be deleted from memory, but only removed from the array of motions.
Returns
True in case the motion has been removed successfully. False in case the motion has not been found or the removal failed.

◆ RemoveMotionByFileName()

bool EMotionFX::MotionManager::RemoveMotionByFileName ( const char *  fileName,
bool  delFromMemory = true,
bool  isTool = true 
)

Remove the motion that has a given file name.

Parameters
[in]fileNameThe file name of the motion to delete from the manager.
delFromMemorySet this to true when if you also want to delete the motion from memory. When set to false, it will not be deleted from memory, but only removed from the array of motions.
[in]isToolSet when calling this function from the tools environment (default).
Returns
True in case the motion has been removed successfully. False in case the motion has not been found or the removal failed.

◆ RemoveMotionByID()

bool EMotionFX::MotionManager::RemoveMotionByID ( uint32  id,
bool  delFromMemory = true 
)

Remove the motion with the given id from the motion manager.

Parameters
[in]idThe id of the motion.
delFromMemorySet this to true when if you also want to delete the motion from memory. When set to false, it will not be deleted from memory, but only removed from the array of motions.
Returns
True in case the motion has been removed successfully. False in case the motion has not been found or the removal failed.

◆ RemoveMotionByName()

bool EMotionFX::MotionManager::RemoveMotionByName ( const char *  motionName,
bool  delFromMemory = true,
bool  isTool = true 
)

Remove the motion with the given name from the motion manager.

Parameters
[in]motionNameThe name of the motion to remove.
delFromMemorySet this to true when if you also want to delete the motion from memory. When set to false, it will not be deleted from memory, but only removed from the array of motions.
[in]isToolSet when calling this function from the tools environment (default).
Returns
True in case the motion has been removed successfully. False in case the motion has not been found or the removal failed.

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