📋 Metadata
- Author: roaoao
- Date: 2016-03-14 11:16:04
- Type:
answer - Reply to: post_00083
💬 Content
draguu:
what if i want to enable bunch of addons together and toggle them off together?
Save this script as scripts/custom_addons.py and use it as external script in Custom tab.
addons = ['mesh_looptools', 'mesh_inset']
enabled = addons[0] in C.user_preferences.addons
icon = 'CHECKBOX_HLT' if enabled else 'CHECKBOX_DEHLT'
op_idname = 'wm.addon_disable' if enabled else 'wm.addon_enable'
cmds = []
for addon in addons:
cmds.append('bpy.ops.%s(module="%s")' % (op_idname, addon))
cmd = "; ".join(cmds)
L.operator('wm.pme_user_command_exec', 'Addons', icon=icon).cmd = cmd
❤️ 1 likes