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::AnimGraphNodeGroup Class Reference

Public Member Functions

AZ_CLASS_ALLOCATOR_DECL AnimGraphNodeGroup ()
 
 AnimGraphNodeGroup (const char *groupName)
 
 AnimGraphNodeGroup (const char *groupName, size_t numNodes)
 
virtual ~AnimGraphNodeGroup ()
 
void SetName (const char *groupName)
 
const char * GetName () const
 
const AZStd::string & GetNameString () const
 
void SetColor (const AZ::u32 &color)
 
AZ::u32 GetColor () const
 
bool GetIsVisible () const
 
void SetIsVisible (bool isVisible)
 
void SetNumNodes (size_t numNodes)
 
size_t GetNumNodes () const
 
void SetNode (size_t index, AnimGraphNodeId nodeId)
 
AnimGraphNodeId GetNode (size_t index) const
 
bool Contains (AnimGraphNodeId nodeId) const
 
void AddNode (AnimGraphNodeId nodeId)
 
void RemoveNodeById (AnimGraphNodeId nodeId)
 
void RemoveNodeByGroupIndex (size_t index)
 
void RemoveAllNodes ()
 
void InitFrom (const AnimGraphNodeGroup &other)
 
void SetNameEditOngoing (bool nameEditOngoing)
 
bool IsNameEditOngoing () const
 
AnimGraphNodeId GetParentNodeId () const
 
void SetParentNodeId (AnimGraphNodeId nodeId)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Protected Attributes

AZStd::vector< AZ::u64 > m_nodeIds
 
AZStd::string m_name
 
AZ::u32 m_color
 
bool m_isVisible
 
bool m_nameEditOngoing = false
 
AnimGraphNodeId m_parentNodeId
 

Constructor & Destructor Documentation

◆ AnimGraphNodeGroup() [1/3]

AZ_CLASS_ALLOCATOR_DECL EMotionFX::AnimGraphNodeGroup::AnimGraphNodeGroup ( )

The default constructor. This does not assign a name and there will be nodes inside this group on default.

◆ AnimGraphNodeGroup() [2/3]

EMotionFX::AnimGraphNodeGroup::AnimGraphNodeGroup ( const char *  groupName)

Extended constructor.

Parameters
groupNameThe name of the group. Please keep in mind that it is not allowed to have two groups with the same name inside a anim graph.

◆ AnimGraphNodeGroup() [3/3]

EMotionFX::AnimGraphNodeGroup::AnimGraphNodeGroup ( const char *  groupName,
size_t  numNodes 
)

Another extended constructor.

Parameters
groupNameThe name of the group. Please keep in mind that it is not allowed to have two groups with the same name inside a anim graph.
numNodesThe number of nodes to create inside the group. This will have all uninitialized values for the node ids in the group, so be sure that you set them all to some valid node index using the AnimGraphNodeGroup::SetNode(...) method. This constructor automatically calls the SetNumNodes(...) method.

◆ ~AnimGraphNodeGroup()

virtual EMotionFX::AnimGraphNodeGroup::~AnimGraphNodeGroup ( )
virtual

The destructor.

Member Function Documentation

◆ AddNode()

void EMotionFX::AnimGraphNodeGroup::AddNode ( AnimGraphNodeId  nodeId)

Add a given node to this group. Please keep in mind that performing an AddNode will result in a reallocation being done. It is much better to use SetNumNodes(...) in combination with SetNode(...) upfront if the total number of nodes is known upfront.

Parameters
nodeIDThe value for the given node. This is the node id where this group will belong to. To get access to the actual node object use AnimGraph::RecursiveFindNodeByID( nodeID ).

◆ Contains()

bool EMotionFX::AnimGraphNodeGroup::Contains ( AnimGraphNodeId  nodeId) const

Check if the node with the given id is inside the node group.

Parameters
nodeIDThe node id to check.
Returns
True in case the node with the given id is inside the node group, false if not.

◆ GetColor()

AZ::u32 EMotionFX::AnimGraphNodeGroup::GetColor ( ) const

Get the color of the group.

Returns
The 32-bit color in COLREF format (0xAABBGGRR) the nodes of the group will be filled with.

◆ GetIsVisible()

bool EMotionFX::AnimGraphNodeGroup::GetIsVisible ( ) const

Check the visibility flag. This flag has been set by the user and identifies if this node group is visible or not.

Returns
True when the node group is marked as visible, otherwise false is returned.

◆ GetName()

const char * EMotionFX::AnimGraphNodeGroup::GetName ( ) const

Get the name of the group as null terminated character buffer.

Returns
The name of the group.

◆ GetNameString()

const AZStd::string & EMotionFX::AnimGraphNodeGroup::GetNameString ( ) const

Get the name of the group, in form of a AZStd::string object.

Returns
The name as a reference to a AZStd::string object.

◆ GetNode()

AnimGraphNodeId EMotionFX::AnimGraphNodeGroup::GetNode ( size_t  index) const

Get the node id for a given node inside the group.

Parameters
indexThe node number inside this group, which must be in range of [0..GetNumNodes()-1].
Returns
The node id, which points inside the Actor object. Use AnimGraph::RecursiveFindNodeByID( nodeID ) to get access to the node information.

◆ GetNumNodes()

size_t EMotionFX::AnimGraphNodeGroup::GetNumNodes ( ) const

Get the number of nodes that remain inside this group.

Returns
The number of nodes inside this group.

◆ GetParentNodeId()

AnimGraphNodeId EMotionFX::AnimGraphNodeGroup::GetParentNodeId ( ) const

Returns the id of the parent AnimGraphNode to which this group belongs. If the group belongs to the root level, this function will return an invalid id. This function is used to make sure that groups can be filtered by level.

◆ InitFrom()

void EMotionFX::AnimGraphNodeGroup::InitFrom ( const AnimGraphNodeGroup other)

Initialize the node group based on another group. Please note that the name of this group will also be copied and it is not allowed to have multiple groups with the same name in the same animgraph.

Parameters
otherThe node group to initialize from.

◆ IsNameEditOngoing()

bool EMotionFX::AnimGraphNodeGroup::IsNameEditOngoing ( ) const

Checks whether the group name is currently being edited from the graph widget.

Returns
True if the group name is currently being edited, false otherwise.

◆ RemoveAllNodes()

void EMotionFX::AnimGraphNodeGroup::RemoveAllNodes ( )

Clear the node group. This removes all nodes.

◆ RemoveNodeByGroupIndex()

void EMotionFX::AnimGraphNodeGroup::RemoveNodeByGroupIndex ( size_t  index)

Remove a given node from the group by the array element index. If for example you wish to remove the 3rd node from the group, you can call RemoveNodeByGroupIndex( 2 ). If you wish to remove a node by its node id, then use RemoveNodeByID(...) instead.

Parameters
indexThe node index in the group. So for example an index value of 5 will remove the sixth node from the group. The index value must be in range of [0..GetNumNodes() - 1].

◆ RemoveNodeById()

void EMotionFX::AnimGraphNodeGroup::RemoveNodeById ( AnimGraphNodeId  nodeId)

Remove a given node from the group by its node id (the value returned by AnimGraphNode::GetID(). If you wish to remove for example the 3rd node inside this group, then use RemoveNodeByGroupIndex(...) instead. Removing a node which is not part of this group will do nothing, except that it wastes performance as it will perform a search inside the list of nodes inside this group.

Parameters
nodeIDThe value for the given node. This is the node id where this group will belong to. To get access to the actual node object use AnimGraph::RecursiveFindNodeByID( nodeID ).

◆ SetColor()

void EMotionFX::AnimGraphNodeGroup::SetColor ( const AZ::u32 &  color)

Set the color of the group.

Parameters
colorThe 32-bit color in COLREF format (0xAABBGGRR) the nodes of the group will be filled with.

◆ SetIsVisible()

void EMotionFX::AnimGraphNodeGroup::SetIsVisible ( bool  isVisible)

Change the visibility state.

Parameters
isVisibleSet to true when the node group is visible, otherwise set it to false.

◆ SetName()

void EMotionFX::AnimGraphNodeGroup::SetName ( const char *  groupName)

Set the name of the group. Please keep in mind that group names must be unique inside the anim graph objects. So you should not have two or more groups with the same name.

Parameters
groupNameThe name of the group.

◆ SetNameEditOngoing()

void EMotionFX::AnimGraphNodeGroup::SetNameEditOngoing ( bool  nameEditOngoing)

Toggles the rendering of a QLineEdit widget to edit the name of the group from the graph widget.

Parameters
nameEditOngoingWhether to trigger the rendering of a text edit widget to change the group name.

◆ SetNode()

void EMotionFX::AnimGraphNodeGroup::SetNode ( size_t  index,
AnimGraphNodeId  nodeId 
)

Set the value of a given node.

Parameters
indexThe node number inside this group, which must be in range of [0..GetNumNodes()-1].
nodeIDThe value for the given node. This is the node id where this group will belong to. To get access to the actual node object use AnimGraph::RecursiveFindNodeByID( nodeID ).

◆ SetNumNodes()

void EMotionFX::AnimGraphNodeGroup::SetNumNodes ( size_t  numNodes)

Set the number of nodes that remain inside this group. This will resize the array of node ids. Don't forget to initialize the node values after increasing the number of nodes.

Parameters
numNodesThe number of nodes that are inside this group.

◆ SetParentNodeId()

void EMotionFX::AnimGraphNodeGroup::SetParentNodeId ( AnimGraphNodeId  nodeId)

Sets the id of the parent AnimGraphNode for this group.

Member Data Documentation

◆ m_color

AZ::u32 EMotionFX::AnimGraphNodeGroup::m_color
protected

The color the nodes of the group will be filled with.

◆ m_name

AZStd::string EMotionFX::AnimGraphNodeGroup::m_name
protected

The unique identification number for the node group name.

◆ m_nameEditOngoing

bool EMotionFX::AnimGraphNodeGroup::m_nameEditOngoing = false
protected

Whether the user is currently typing a new name

◆ m_nodeIds

AZStd::vector<AZ::u64> EMotionFX::AnimGraphNodeGroup::m_nodeIds
protected

The node ids that are inside this group.

◆ m_parentNodeId

AnimGraphNodeId EMotionFX::AnimGraphNodeGroup::m_parentNodeId
protected

The id of the parent AnimGraphNode


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