# Set\_Icon - How to use \[Python\]

**URL:** <https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847>\
**Category:** Feedback & Requests\
**Tags:** icon, menu-creation, unreal-engine, UE5-0, issue, question\
**Created:** [August 13, 2022, 7:19pm UTC](https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847 "2022-08-13T19:19:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nemecys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nemecys](https://forums.unrealengine.com/u/Nemecys)\
**Post date:** [August 13, 2022, 7:19pm UTC](https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847/1 "2022-08-13T19:19:57Z")

</div>

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](https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/ToolMenuEntry.html?highlight=set_icon%20tool%20menu%20entry#unreal.ToolMenuEntry.set_icon)

```auto
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?

---

<div class="post-metadata">

**Author:** ![Hannes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hannes](https://forums.unrealengine.com/u/Hannes)\
**Post date:** [February 15, 2023, 4:04pm UTC](https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847/2 "2023-02-15T16:04:55Z")

</div>

believe you need to put the attributes used by ScriptSlateIcon in there.  
see [unreal.ScriptSlateIcon — Unreal Python 4.26 (Experimental) documentation](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/ScriptSlateIcon.html)  
not much info sadly, unreal docs need some love.

some random code showing how to use it. [source](https://blog.l0v0.com/posts/fe336621.html)

```python
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](https://docs.unrealengine.com/4.26/en-US/API/Editor/EditorStyle/).FEditorStyle  
_A collection of named properties that guide the appearance of Slate._

[here](https://github.com/EpicKiwi/unreal-engine-editor-icons)’s a collection of the icons in unreal by name

---

<div class="post-metadata">

**Author:** ![ZQlby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZQlby](https://forums.unrealengine.com/u/ZQlby)\
**Post date:** [April 28, 2023, 7:10am UTC](https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847/3 "2023-04-28T07:10:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![realtymekenya](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@realtymekenya](https://forums.unrealengine.com/u/realtymekenya)\
**Post date:** [October 14, 2024, 1:20pm UTC](https://forums.unrealengine.com/t/set-icon-how-to-use-python/627847/4 "2024-10-14T13:20:13Z")

</div>

Long time lurker, first post on the forums! L

 ![Example_Add_Icon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/0/b0053d23daa1b448617ac99e94098fc10984520e.jpeg)  
et me chime in on an old thread

```auto
import unreal

# =====================================================
# ===== ON A SEPARATE CLASS FILE SOMEHWHERE FOR ORDERELY Management

@unreal.uclass()
class ExampleClass(unreal.ToolMenuEntryScript):
    @unreal.ufunction(override=True)
    def execute(self, context):
        print("Am about to change your whole work flow")

menus = unreal.ToolMenus.get()
MySubMenu = menus.extend_menu("LevelEditor.MainMenu")

# Init all the data at once!
menuScriptData = unreal.ToolMenuEntryScriptData( menu = MySubMenu.menu_name,
                                section = "YourSectionName",
                                name = "YourName",
                                label = "My New Python Tool",
                                tool_tip = "Tell Me what this tool/command does",

                                # Set the icon. You can use the Widget Reflector in Unreal to help locate
                                # the various icons. Use the Used By name when you hover.
                                icon = unreal.ScriptSlateIcon("EditorStyle", "Sequencer.CreateCamera"),

                                # insert_position = unreal.ToolMenuInsert("Section Name", unreal.ToolMenuInsertType.DEFAULT )
                                                )

menuScript = ExampleClass()
menuScript.set_editor_property("data", menuScriptData)

# End Dummy class
# =====================================================

menus = unreal.ToolMenus.get()
mainMenu = menus.find_menu("LevelEditor.MainMenu")

myNewMenu = mainMenu.add_sub_menu(owner = mainMenu.get_name(), 
                                section_name = "TheMenuSection", 
                                name = "TheMenuName",
                                label = "Name Of the tool",
                                tool_tip = "Work Smart, Not Hard! Speed is king in today's age!")

MySubMenu = myNewMenu.add_sub_menu(owner = myNewMenu.get_name(), 
                                     section_name = "MySubMenuSection", 
                                     name = "MySubMenu",
                                     label = "My Sub Menu",
                                     tool_tip = "Tell me what this tool does! LOL")

entry = unreal.ToolMenuEntry( name = "ReImportCameraAnimation_Entry",
                                type = unreal.MultiBlockType.MENU_ENTRY,
                                insert_position = unreal.ToolMenuInsert("MySubMenuSection", unreal.ToolMenuInsertType.DEFAULT ),
                                script_object = menuScript )

MySubMenu.add_menu_entry("MySubMenuSection", entry)

```
