Post #3283: : post_03284
🏷️ Tags
v1-20-x pie-menu configuration intermediate solved
⚙️ Related PME Features
- Pie Menu Editor
- Custom Icons
- Python Scripting
- Hotkey Configuration
💬 Content
tukor:
The perfect thing would be just a button, with the name of the plugin, and you just click it and it enables/disables the plugin, and also tint the button or something when its enabled:
Hi @tukor,
Use addon’s module name as a name for the button (eg mesh_f2) and use this code in Custom tab (Blender 2.80+):
addon = slot; import addon_utils as au; info = au.module_bl_info(au.addons_fake_modules.get(addon)); is_enabled = addon in {a.module for a in C.preferences.addons}; L.operator("preferences.addon_disable" if is_enabled else "preferences.addon_enable", text=info["name"], depress=is_enabled).module = addon
❤️ 4 likes