MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / PostDeserialize

Method PostDeserialize

Code/EngineTools/NodeGraph/NodeGraph_FlowGraph.cpp:560–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

CreateTypeFunction · 0.45
CreateTypeInPlaceFunction · 0.45
ReadTypeMethod · 0.45

Calls 8

PostDeserializeFunction · 0.85
FindNodeFunction · 0.85
GetOutputPinMethod · 0.80
GetInputPinMethod · 0.80
RefreshDynamicPinsMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected