devran
(Devran)
April 12, 2024, 5:22pm
1
The past couple days I have been trying to find a way to get the selected nodes in the blueprint editor graph, but I’m stuck at getting the current active graph. I have looked in various classes like FBlueprintEditor, SGraphEditor, etc. and followed function calls but I didn’t get very far.
Any help would be much appreciated!
devran
(Devran)
April 20, 2024, 3:39pm
2
Figured it out with the help of another thread:
TArray<UObject*> EditedAssets = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->GetAllEditedAssets();
for (UObject* Asset : EditedAssets)
{
IAssetEditorInstance* AssetEditorInstance = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->FindEditorForAsset(Asset, false);
FAssetEditorToolkit* AssetEditorToolkit = static_cast<FAssetEditorToolkit*>(AssetEditorInstance);
TSharedPtr<SDockTab> Tab = AssetEditorToolkit->GetTabManager()->GetOwnerTab();
if (Tab->IsForeground())
{
FBlueprintEditor* BlueprintEditor = static_cast<FBlueprintEditor*>(AssetEditorToolkit);
FGraphPanelSelectionSet SelectedNodes = BlueprintEditor->GetSelectedNodes();
}
}
2 Likes
system
(system)
Closed
May 20, 2024, 3:40pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.