Set_Icon - How to use [Python]

Hey trying to finesse some custom tools menu in the editor that i’ve created with a python script.

I want to add custom icons like the ones you see in all the other main menus at the top of the editor.

https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/ToolMenuEntry.html?highlight=set_icon%20tool%20menu%20entry#unreal.ToolMenuEntry.set_icon

set_icon(style_set_name, style_name='None', small_style_name='None') → None
Set Icon

Parameters
style_set_name (Name) –

style_name (Name) –

small_style_name (Name) –

The above code is just too vague for me to understanding, I can’t find any references to the existing icons available in engine or what the variables are looking for exactly.

Is there any further documentation or hints on this?

believe you need to put the attributes used by ScriptSlateIcon in there.
see unreal.ScriptSlateIcon — Unreal Python 4.26 (Experimental) documentation
not much info sadly, unreal docs need some love.

some random code showing how to use it. source

icon = unreal.ScriptSlateIcon("EditorStyle","ContentBrowser.AssetActions.Delete")
menus = unreal.ToolMenus.get()
menu = menus.find_menu("ContentBrowser.AddNewContextMenu")
entry.set_icon("EditorStyle","ContentBrowser.AssetActions.Edit")

EditorStyle.FEditorStyle
A collection of named properties that guide the appearance of Slate.

here’s a collection of the icons in unreal by name

1 Like

how to use custom icon, i make a toolbar plugin with py api, and i just found, it seems? all the icons are preset in ue souce code in which i dont want to relate.