MCPcopy Create free account
hub / github.com/MothCocoon/FlowGraph / ProcessAsset

Method ProcessAsset

Source/FlowEditor/Private/Find/FindInFlow.cpp:589–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589bool SFindInFlow::ProcessAsset(UFlowAsset* Asset, FSearchResult ParentResult, const TArray<FString>& Tokens, int32 Depth)
590{
591 if (!Asset || !Asset->GetGraph() || Depth >= MaxSearchDepth || SearchResults.VisitedAssets.Contains(Asset))
592 {
593 return false;
594 }
595
596 SearchResults.VisitedAssets.Add(Asset);
597
598 bool bAnyMatches = false;
599
600 for (UEdGraphNode* EdNode : Asset->GetGraph()->Nodes)
601 {
602 const TMap<EFlowSearchFlags, TSet<FString>>* CategoryStrings = BuildCategoryStrings(EdNode, Depth);
603
604 if (!CategoryStrings)
605 {
606 continue;
607 }
608
609 EFlowSearchFlags NodeMatchedFlags = EFlowSearchFlags::None;
610
611 for (const TPair<EFlowSearchFlags, TSet<FString>>& Pair : *CategoryStrings)
612 {
613 const TSet<FString>& StringSet = Pair.Value;
614 if (EnumHasAnyFlags(SearchFlags, Pair.Key) && StringSetMatchesSearchTokens(Tokens, StringSet))
615 {
616 EnumAddFlags(NodeMatchedFlags, Pair.Key);
617 }
618 }
619
620 if (NodeMatchedFlags != EFlowSearchFlags::None)
621 {
622 FString Title = EdNode->GetNodeTitle(ENodeTitleType::ListView).ToString();
623 if (Title.IsEmpty())
624 {
625 Title = EdNode->GetClass()->GetName();
626 }
627
628 FSearchResult Result = MakeShareable(new FFindInFlowResult(Title, ParentResult, EdNode, Depth > 0, Asset));
629 Result->MatchedFlags = NodeMatchedFlags;
630 ParentResult->Children.Add(Result);
631
632 bAnyMatches = true;
633 }
634
635 bAnyMatches |= RecurseIntoSubgraphsIfEnabled(EdNode, ParentResult, Tokens, Depth);
636 }
637
638 return bAnyMatches;
639}
640
641bool SFindInFlow::RecurseIntoSubgraphsIfEnabled(UEdGraphNode* EdNode, FSearchResult ParentResult, const TArray<FString>& Tokens, int32 Depth)
642{

Callers

nothing calls this directly

Calls 4

ToStringMethod · 0.80
GetNodeTitleMethod · 0.80
IsEmptyMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected