Skip to content
hannesdelbeke edited this page May 10, 2024 · 9 revisions

startup

load UniMenu on startup with init_unreal.py

  • either in your project
  • or a better way. in your plugin content/python folder

parent menus

to parent your menu to the main menu, or the tools menu:

parent_path = "LevelEditor.MainMenu"
parent_path = "LevelEditor.MainMenu.Tools"

To parent your menu to the 'asset right-click context-menu': (this might error if you haven't yet opened the context menu on asset right click)

parent_path = "ContentBrowser.AssetContextMenu"

Icons

default icons

style_names can be found here ...\Engine\Source\Editor\EditorStyle\Private\SlateEditorStyle.cpp - look for the name here

# e.g. Set( "BlueprintEditor.AddNewMacroDeclaration", new IMAGE_BRUSH( "Icons/icon_Blueprint_AddMacro_40px", Icon40x40) );
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^         <--         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
entry.set_icon("EditorStyle", style_name=self.icon)

We support this, but unclear how.

  • todo add sample

No documentation on unreal docs for unreal.ToolMenuEntry.add_icon() Believe it relates too ScriptSlateIcon Discussing on the forum

custom icons

it is not possible to register custom icons with Python, can only use the built-in icons Icon's are here ...\Engine\Content\Editor\Slate\Icons - look for the icon name here

TODO, figure out how to

Clone this wiki locally