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.
OnToolBarChameleon¶
The green chameleon icon: ,on the main toolbar is used for placing ChameleonTools.
OnSelectAssetsMenu¶
Right-click on selected assets to access the 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.
OnMainMenu¶
Access the menu items under the Tools menu in the main menu.
OnOutlineMenu¶
Right-click on an object in the Outline window to access the context 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"
.
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)"
}
]
}
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.
More information on interface and logic Reload can be found here:Automatically reload Python logic on startup
Related Links¶
Additionally, you can add menu items to the Material Editor, Physics Asset Editor, and more through configuration. Details can be foundExtend an Assets Editor