Search code examples
unreal-engine4unreal-blueprint

Is there a Command or feature to open ue4 to a specific file in the editor?


I want to build commands, or shortcuts, or hyperlinks that takes a windows user to a specific file (i.e blueprint editor, or any destination file within a ue4 project ) .

Currently i navigate the content browser and double-click files to open them in the editor. I want to deeplink some of these destinations so that I dont have to use the content browser. I prefer an answer that uses executable commands to open files within UE4 (fresh startup, and within existing ue4.exe).


Solution

  • The editor has this functionality built into it. It's called Open Asset....

    Go to Main Menu > File > Open Asset... or press Control+P or Alt+Shift+O to bring up the Open Assets... window.

    Open Assets Window

    You can change the default shortcut keys in Main Menu > Edit > Editor Preferences... > General > Keyboard Shortcuts > System-wide > Open Asset....

    Open Asset Editor Command

    From C++

    Use FContentBrowserModule::SyncBrowserToAssets.

    Example:

    FContentBrowserModule& ContentBrowserModule = FModuleManager::Get().LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
    ContentBrowserModule.Get().SyncBrowserToAssets( InObjectsToSync, false, bFocusContentBrowser );
    

    For convenience, you can also use UEditorEngine::SyncBrowserToObjects like this:

    GEditor->SyncBrowserToObjects(Objects);
    

    From Blueprints

    Use the Editor Scripting Utilities plugin to Sync Browser to Objects.

    Sync Browser to Objects

    To use this, you must enable the Editor Scripting Utilities plugin (currently experimental, API subject to change).

    Enable Editor Scripting Utilities Plugin