Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraph.cpp
bool NodeGraph::CheckIfHasConnection(GraphNode* sourceNode, AZ::u16 outputPortNr, GraphNode* targetNode, AZ::u16 inputPortNr) const
    {
        const size_t numConnections = targetNode->GetNumConnections();
        for (size_t i = 0; i < numConnections; ++i)
        {
            NodeConnection* connection = targetNode->GetConnection(i);

            // check if the connection properties are equal
            if (connection->GetInputPortNr() == inputPortNr)
            {
                if (connection->GetSourceNode() == sourceNode)
                {
                    if (connection->GetOutputPortNr() == outputPortNr)
                    {
                        return true;
                    }
                }
            }
        }

        return false;
    }
// check if this connection already exists
check if this connection already exists
check if this connection already exists
bool NodeGraph::CheckIfHasConnection(GraphNode* sourceNode, AZ::u16 outputPortNr, GraphNode* targetNode, AZ::u16 inputPortNr) const
    {
        const size_t numConnections = targetNode->GetNumConnections();
        for (size_t i = 0; i < numConnections; ++i)
        {
            NodeConnection* connection = targetNode->GetConnection(i);
            if (connection->GetInputPortNr() == inputPortNr)
            {
                if (connection->GetSourceNode() == sourceNode)
                {
                    if (connection->GetOutputPortNr() == outputPortNr)
                    {
                        return true;
                    }
                }
            }
        }
        return false;
    }
bool NodeGraph :: CheckIfHasConnection ( GraphNode * sourceNode , AZ :: u16 outputPortNr , GraphNode * targetNode , AZ :: u16 inputPortNr ) const { const size_t numConnections = targetNode -> GetNumConnections ( ) ; for ( size_t i = 0 ; i < numConnections ; ++ i ) { NodeConnection * connection = targetNode -> GetConnection ( i ) ; if ( connection -> GetInputPortNr ( ) == inputPortNr ) { if ( connection -> GetSourceNode ( ) == sourceNode ) { if ( connection -> GetOutputPortNr ( ) == outputPortNr ) { return true ; } } } } return false ; }
check if this connection already exists
check if this connection already exists
// check if the connection properties are equal