Post #79: : post_00080
🏷️ Tags
pie-menu custom-scripting intermediate solved
⚙️ Related PME Features
- Pie Menu Editor
- Custom tab scripting
- Python scripting
💬 Content
draguu:
how do i make toggle button ? like suppose i want to toggle looptools addon , it should be on/off from pie menu, right now when i tried it doesnt asked me to select if its property or command , it just took it as command ,
Use this code in Custom tab:
addon = 'mesh_looptools'; enabled = addon in C.user_preferences.addons; icon = 'CHECKBOX_HLT' if enabled else 'CHECKBOX_DEHLT'; op_idname = 'wm.addon_disable' if enabled else 'wm.addon_enable'; L.operator(op_idname, 'Loop Tools', icon=icon).module = addon