Post #2354: ![](https://blenderartists.org/user_avatar/blenderartists.org/casterle/48/570987

πŸ“‹ Metadata

🏷️ Tags

pie-menu state-highlighting intermediate

  • Pie Menu Editor
  • Custom tab scripting
  • Python operator execution

πŸ’¬ Content

casterle:

how to apply state highlighting to my pie menu slots

Depends on the button/slot you want to highlight.

casterle:

For example, on the standard Z menu, the state is displayed by highlighting enabled items with a blue background.

Z menu β€œuses” this code in the first slot of the pie (Custom tab):

L.prop(C.space_data.shading, "type", expand=True)

In Blender 2.80+ you can highlight tool buttons using depress=True argument (Custom tab):

L.operator("pme.exec", text="Hello World", depress=True).cmd = "print('Hello World')"

πŸ”— View on Blender Artists