Post #3984: Yes, you can even nest them and use different modifier keys in the same item

📋 Metadata

🏷️ Tags

pie-menu hotkeys advanced

  • Pie Menu Editor
  • Python Scripting

💬 Content

Yes, you can even nest them and use different modifier keys in the same item

In command tab:

1 modifier key
operator2 if E.alt == True else operator1

2 modifier keys
operator2 if E.alt == True else (operator3 if E.ctrl == True else operator1)

3 modifier keys
operator2 if E.alt == True else (operator3 if E.ctrl == True else (operator4 if E.shift == True else operator1))


E.alt, E.ctrl and E.shift are interchangeable and operator1 its going to be the item with no modifier key.

A working example:

bpy.ops.object.modifier_add('EXEC_DEFAULT', True, type='BEVEL') if E.alt == True else (bpy.ops.object.modifier_add('EXEC_DEFAULT', True, type='SOLIDIFY') if E.ctrl == True else (bpy.ops.object.modifier_add('EXEC_DEFAULT', True, type='DECIMATE') if E.shift == True else bpy.ops.object.subdivision_set('EXEC_DEFAULT', True, level=1, relative=False)))

❤️ 2 likes


🔗 View on Blender Artists