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

Method FocusViewport

Source/FlowEditor/Private/Graph/FlowGraphEditor.cpp:1547–1574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1545}
1546
1547void SFlowGraphEditor::FocusViewport() const
1548{
1549 // Iterator used but should only contain one node
1550 for (const UFlowGraphNode* SelectedNode : GetSelectedFlowNodes())
1551 {
1552 const UFlowNode* FlowNode = Cast<UFlowNode>(SelectedNode->GetFlowNodeBase());
1553 if (UFlowNode* InspectedInstance = FlowNode->GetInspectedInstance())
1554 {
1555 if (AActor* ActorToFocus = InspectedInstance->GetActorToFocus())
1556 {
1557 GEditor->SelectNone(false, false, false);
1558 GEditor->SelectActor(ActorToFocus, true, true, true);
1559 GEditor->NoteSelectionChange();
1560
1561 GEditor->MoveViewportCamerasToActor(*ActorToFocus, false);
1562
1563 const FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
1564 const TSharedPtr<SDockTab> LevelEditorTab = LevelEditorModule.GetLevelEditorInstanceTab().Pin();
1565 if (LevelEditorTab.IsValid())
1566 {
1567 LevelEditorTab->DrawAttention();
1568 }
1569 }
1570 }
1571
1572 return;
1573 }
1574}
1575
1576bool SFlowGraphEditor::CanFocusViewport() const
1577{

Callers

nothing calls this directly

Calls 4

GetFlowNodeBaseMethod · 0.80
GetInspectedInstanceMethod · 0.80
GetActorToFocusMethod · 0.80
IsValidMethod · 0.80

Tested by

no test coverage detected