Post #3025: ![](https://blenderartists.org/user_avatar/blenderartists.org/anphung/48/39426_2

📋 Metadata

  • Author: roaoao
  • Date: 2020-02-17 03:14:52
  • Type: answer
  • Quality Score: 9/10
  • Reply to: post_03024

🏷️ Tags

pie-menu hotkeys advanced solved

  • Property Editor
  • Custom tab
  • Python Scripting
  • Hotkey Configuration

💬 Content

anphung:

Is it possible to add Disable by Tag(s) to this Property?

Hi @anphung,
Yes, use this code as getter:

tag = "Select Linked"; has_enabled_menus = len([m for m in prefs().pie_menus if tag in m.tag and m.enabled]) > 0; return has_enabled_menus

Setter:

bpy.ops.pme.pm_enable_by_tag(tag="Select Linked", enable=value)

Another way to create this button is to use Custom tab with this code. No need to add a new Property in this case.

tag = "Select Linked"; has_enabled_menus = len([m for m in prefs().pie_menus if tag in m.tag and m.enabled]) > 0; operator(L, "pme.pm_enable_by_tag", text=tag, icon='CHECKBOX_HLT' if has_enabled_menus else 'CHECKBOX_DEHLT',  depress=has_enabled_menus, enable=not has_enabled_menus, tag=tag)

❤️ 2 likes


🔗 View on Blender Artists