| 558 | //------------------------------------------------------------------------- |
| 559 | |
| 560 | void FlowGraph::PostDeserialize( TypeSystem::TypeRegistry const& typeRegistry ) |
| 561 | { |
| 562 | BaseGraph::PostDeserialize( typeRegistry ); |
| 563 | |
| 564 | // Refresh all dynamic pins |
| 565 | for ( TTypeInstance<BaseNode>& nodeInstance : m_nodes ) |
| 566 | { |
| 567 | auto pFlowNode = nodeInstance.TryGetAs<FlowNode>(); |
| 568 | if ( pFlowNode != nullptr ) |
| 569 | { |
| 570 | pFlowNode->RefreshDynamicPins(); |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | // Validate all connections |
| 575 | for ( int32_t i = int32_t( m_connections.size() - 1 ); i >= 0; i-- ) |
| 576 | { |
| 577 | Connection& connection = m_connections[i]; |
| 578 | FlowNode* pFromNode = TryCast<FlowNode>( FindNode( connection.m_fromNodeID ) ); |
| 579 | FlowNode* pToNode = TryCast<FlowNode>( FindNode( connection.m_toNodeID ) ); |
| 580 | |
| 581 | if ( pFromNode == nullptr || pToNode == nullptr ) |
| 582 | { |
| 583 | EE_LOG_WARNING( LogCategory::Tools, "Node Graph", "Invalid connection detected and removed during deserialization" ); |
| 584 | m_connections.erase( m_connections.begin() + i ); |
| 585 | continue; |
| 586 | } |
| 587 | |
| 588 | Pin* pOutputPin = pFromNode->GetOutputPin( connection.m_outputPinID ); |
| 589 | Pin* pInputPin = pToNode->GetInputPin( connection.m_inputPinID ); |
| 590 | |
| 591 | if ( pOutputPin == nullptr || pInputPin == nullptr ) |
| 592 | { |
| 593 | EE_LOG_WARNING( LogCategory::Tools, "Node Graph", "Invalid connection detected and removed during deserialization" ); |
| 594 | m_connections.erase( m_connections.begin() + i ); |
| 595 | continue; |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | UUID FlowGraph::RegenerateIDs( THashMap<UUID, UUID>& IDMapping ) |
| 601 | { |
no test coverage detected