Post #1510: : post_01511
🏷️ Tags
pie-menu hotkeys intermediate solved
⚙️ Related PME Features
- Command tab
- Property tab
- Custom tab
- Custom Icons
- Python Scripting
💬 Content
bitinn:
Just wondering, is it possible to call
wm.context_togglein a menu item with Pie Menu Editor. I want to emulate what I can do with Blender Input key-binding. But it seems like the closest option I got is to use “Property”, which will toggle the true/false value just likewm.context_toggle, but using Property doesn’t allow me to customize menu icon for some reasons?
You can call it in Command tab, eg:
bpy.ops.wm.context_toggle(data_path='tool_settings.use_proportional_edit_objects')
Or use in Property tab:
C.tool_settings.use_proportional_edit_objects
If you want to use custom icon you need to use Custom tab:
operator(L, "wm.context_toggle", icon='CHECKBOX_HLT' if C.tool_settings.use_proportional_edit_objects else 'CHECKBOX_DEHLT', data_path='tool_settings.use_proportional_edit_objects')