Bootstrap Chameleon Logo

Built-in Menu Items

Built-in menus provide a starting point for using the Unreal Engine editor more efficiently.

TIP
Built-in tools are available with the plugin release and can also be found at DefaultResources@Github

Built-in Menus

OnToolbar

he Python icon dropdown button on the main toolbar is used for placing Python commands that execute directly. This menu provides quick access toAccessing Objects in the Editor, printing resource references and dependencies, and executing GC commands.

G23_command_menu

OnToolBarChameleon

The green chameleon icon: Green chameleon icon with Python logo in the background,on the main toolbar is used for placing ChameleonTools.

Chameleon Tools drop-down menu in Unreal Engine's main toolbar

OnSelectAssetsMenu

Right-click on selected assets to access the context menu

Menu item in selected asset's context menu

In the menu configuration, the "canExecuteAction" field is used. The return value of the Python code within this field determines whether the menu item is clickable (grayed out when not clickable).

MenuConfig.json::OnSelectAssetsMenu

"name": "TA Python Example",
"items": [
    {
        "name": "Example (3): Log BP Classes",
        "tooltip": "Only Actived when Blueprint selected",
        "command": "import Utilities, QueryTools; QueryTools.Utils.log_classes(Utilities.Utils.get_selected_assets()[0]) ",
        "canExecuteAction": "import QueryTools; return QueryTools.Utils.is_selected_asset_type([unreal.Blueprint])"
    }
]

TIP
The code in "canExecuteAction" is executed during the widget Tick, so avoid using heavy Python code.

OnSelectFolderMenu

Right-click on a selected folder or empty space in the ContentBrowser to access the context menu.

This menu demonstrates menu items and sub-menu items.

Content menu items of selected folder in Unreal Engine's Content Browser

OnMainMenu

Access the menu items under the Tools menu in the main menu.

'083_main_menu

OnOutlineMenu

Right-click on an object in the Outline window to access the context menu.

TAPython-created menu items in Unreal Engine's main menu

OnMaterialEditorMenu

Access the menu items under the Tools menu in the Material Editor. Features include printing selected nodes and assigning them to the global variable "_r".

TAPython-created menu items in Unreal Engine's Material Editor

OnTabContextMenu

"OnTabContextMenu" is a global menu item that applies to all ChameleonTools (except Sketch).

TIP
"OnTabContextMenu" is only valid in UE5.

In the default resources, a "Reload this tool" menu item has been added to all ChameleonTools. ChameleonTools can automatically update modified interfaces when reopened, allowing the interface and logic to take effect immediately during tool development.

MenuConfig.json

"OnTabContextMenu":{
    "name": "TA Python Tab",
    "items": [
        {
            "name": "Reload this tool",
            "command": "unreal.ChameleonData.request_close(%tool_path); unreal.ChameleonData.launch_chameleon_tool(%tool_path)"
        }
    ]
}

Reload the tool menu in Shelf tool tab's context menu

For example, in the following illustration, we can modify the interface and Python logic simultaneously and use the "Reload" menu to make the changes take effect immediately.

G_014_ReloadLogic_s

More information on interface and logic Reload can be found here:Automatically reload Python logic on startup

Additionally, you can add menu items to the Material Editor, Physics Asset Editor, and more through configuration. Details can be foundExtend an Assets Editor