Post #563: ka

📋 Metadata

🏷️ Tags

pie-menu panel-group scripting intermediate solved

  • Pie Menu Editor
  • Panel Group Editor
  • Python Scripting
  • Command tab

💬 Content

kalipsotri:

Is there a simple way to create pie menu to hide/show panel groups by category?

The easiest way is to hide/show panel groups by name. Use this in Command tab:

Show panel group:

toggle_menu("Your Panel Group", value=True)

Hide panel group:

toggle_menu("Your Panel Group", value=False)

Toggle panel group:

toggle_menu("Your Panel Group")

To hide/show panel groups by category you can use this code:

Show:

[toggle_menu(p.name, True) for p in prefs().pie_menus if p.mode == 'PANEL' and p.panel_category == "Your Category"]

Hide:

[toggle_menu(p.name, False) for p in prefs().pie_menus if p.mode == 'PANEL' and p.panel_category == "Your Category"]

❤️ 3 likes


🔗 View on Blender Artists