Course contentsShow
← Unreal Engine Game Development
Lesson 79 of 8801. Foundations and Editor WorkflowFree lesson

Integrating Asset Actions into Content Browser Menus

Extend the right-click context menus in the Content Browser to perform custom operations on specific asset types directly from the project explorer.

In this lesson, you will learn how to inject your own custom functionality directly into the Content Browser’s right-click menu to streamline your asset workflow.

Why Extend the Content Browser?

When working on large projects, you often perform repetitive tasks on specific asset types, such as generating reports, migrating data, or applying standardized naming conventions. Instead of forcing users to open an Editor Utility Widget, you can place these actions exactly where users interact with assets: the context menu.

The Mechanism: AssetTypeActions

In Unreal Engine, this is achieved by inheriting from FAssetTypeActions_Base. This class acts as a bridge between a specific asset class (like a custom Data Asset) and the Editor's menu system. By overriding the GetActions method, you tell the Editor which menu items to display when a user right-clicks an asset of that type.

Here is a simplified structural example of how you define the menu action:

void FMyCustomAssetActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
    // Define the custom command
    MenuBuilder.AddMenuEntry(
        FText::FromString("Run Custom Utility"),
        FText::FromString("Executes my specialized logic"),
        FSlateIcon(),
        FUIAction(FExecuteAction::CreateSP(this, &FMyCustomAssetActions::ExecuteMyLogic, InObjects))
    );
}

Registration Workflow

To make this appear, you must register your action class during your module's startup phase. Using the IAssetTools interface provided by the AssetTools module, you tell the engine: "Whenever an asset of type UMyCustomAsset is clicked, include FMyCustomAssetActions in the menu."

Once registered, the Editor handles the rest. It detects the selection, calls your GetActions function, and appends your logic to the existing stack of engine-default commands (like "Save," "Rename," or "Delete"). This keeps your specialized tools tucked away until they are needed, creating a clean, professional interface for your team.

Key Takeaway: By implementing FAssetTypeActions_Base, you transform the Content Browser into a command center, allowing you to trigger custom automated logic on assets with a single click.