Post #1917: ![](https://blenderartists.org/user_avatar/blenderartists.org/colacuve/48/535989

📋 Metadata

  • Author: roaoao
  • Date: 2019-02-03 10:25:44
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_01914

🏷️ Tags

pie-menu custom-scripting intermediate solved

  • Pie Menu Editor
  • Custom Tab
  • Python Scripting
  • Icon Viewer

💬 Content

Colacuve:

Is it possible to toggle the icon of a pie menu item depending on the mode?

Yes, you can use Custom tab for this:

L.operator("object.editmode_toggle", text="Object Mode" if C.mode == 'OBJECT' else "Edit Mode", icon='OBJECT_DATAMODE' if C.mode == 'OBJECT' else 'EDITMODE_HLT')

You can find and copy icon names in Icon Viewer add-on (Settings - Add-ons - Development category - Icon Viewer)
Here is a list of functions you can use in Custom tab.


🔗 View on Blender Artists