I wrote this code to create a pie menu for the toolbar.
class my_translate_piemenu(Menu):
bl_label = "Translate"
bl_idname = "my_translate_piemenu"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
pie.operator("wm.tool_set_by_id", text = "Annotate").name = 'builtin.annotate'
pie.operator("wm.tool_set_by_id", text = "Rotate").name = 'builtin.rotate'
pie.operator("wm.tool_set_by_id", text = "Transform").name = 'builtin.transform'
pie.operator("wm.tool_set_by_id", text = "Select Box").name = 'builtin.select_box'
pie.operator("wm.tool_set_by_id", text = "Cursor").name = 'builtin.cursor'
pie.operator("wm.tool_set_by_id", text = "Move").name = 'builtin.move'
pie.operator("wm.tool_set_by_id", text = "Measure").name = 'builtin.measure'
pie.operator("wm.tool_set_by_id", text = "Scale").name = 'builtin.scale'
pie.separator()
pie.separator()
Here is the resulting pie menu.
I would like to add an icon to this pie menu.
To add an icon, you need to write “icon = hoge” as the third argument of “pie.operator()”.
However, I don’t know the name of the toolbar icon.
I used an add-on called “Develolpment: Icon Viewer,” but it could not tell me the name of the icon in the toolbar.
Also, I searched Google and found similar questions to mine, but it didn’t tell me what I needed to do…
Can anyone tell me how to know the name of the toolbar icon when specifying it in Python code?
Translated with www.DeepL.com/Translator (free version)