unreal.ToolMenus

class unreal.ToolMenus(outer=None, name='None')

Bases: unreal.Object

Tool Menus

C++ Source:

  • Module: ToolMenus

  • File: ToolMenus.h

Editor Properties: (see get_editor_property/set_editor_property)

  • customized_menus (Array(CustomizedToolMenu)): [Read-Write] Customized Menus

  • menu_substitutions_during_generate (Map(Name, Name)): [Read-Write] Allow substituting one menu for another during generate but not during find or extend

classmethod add_menu_entry_object(menu_entry_object)bool

Registers menu entry object from blueprint/script

Parameters

menu_entry_object (ToolMenuEntryScript) –

Returns

Return type

bool

extend_menu(name)ToolMenu

Extends a menu without registering the menu or claiming ownership of it. Ok to call even if menu does not exist yet.

Parameters

name (Name) – Name of the menu to extend

Returns

ToolMenu Menu object

Return type

ToolMenu

classmethod find_context(context, class_)Object

Finds a context object of a given class if it exists

Parameters
Returns

Return type

Object

find_menu(name)ToolMenu

Finds an existing menu that has been registered or extended.

Parameters

name (Name) – Name of the menu to find.

Returns

ToolMenu Menu object. Returns null if not found.

Return type

ToolMenu

classmethod get()ToolMenus

Get

Returns

Return type

ToolMenus

is_menu_registered(name)bool

Determines if a menu has already been registered.

Parameters

name (Name) – Name of the menu to find.

Returns

bool True if menu has already been registered.

Return type

bool

refresh_all_widgets()None

Rebuilds all currently generated widgets next tick.

refresh_menu_widget(name)bool

Rebuilds all widgets generated from a specific menu.

Parameters

name (Name) –

Returns

Return type

bool

register_menu(name, parent='None', type=MultiBoxType.MENU, warn_if_already_registered=True)ToolMenu

Registers a menu by name

Parameters
  • name (Name) –

  • parent (Name) – Optional name of a menu to layer on top of.

  • type (MultiBoxType) – Type of menu that will be generated such as: ToolBar, VerticalToolBar, etc..

  • warn_if_already_registered (bool) – Display warning if already registered

Returns

ToolMenu Menu object

Return type

ToolMenu

remove_entry(menu_name, section, name)None

Removes a menu entry from a given menu and section

Parameters
remove_menu(menu_name)None

Unregisters a menu by name

Parameters

menu_name (Name) –

remove_section(menu_name, section)None

Removes a section from a given menu

Parameters
  • menu_name (Name) –

  • section (Name) –

set_section_label(menu_name, section_name, label)None

Sets a section’s displayed label text.

Parameters
  • menu_name (Name) –

  • section_name (Name) –

  • label (Text) –

set_section_position(menu_name, section_name, other_section_name, position_type)None

Sets where to insert a section into a menu when generating relative to other section names.

Parameters
unregister_owner_by_name(owner_name)None

Removes all entries that were registered under a specific owner name

Parameters

owner_name (Name) –