Post #2394: cy

πŸ“‹ Metadata

🏷️ Tags

pie-menu python-scripting intermediate solved

  • Custom Tab
  • Pie Menu Editor
  • Python Scripting
  • Operator Integration

πŸ’¬ Content

cyso:

Can all functions be realized via the costum tab?

Not all but most of them.

cyso:

Tried the following:
L.operator(bpy.ops.mesh.primitive_monkey_add(), text=β€œβ€, icon=β€˜MESH_MONKEY’)

Try this:

L.operator("mesh.primitive_monkey_add", text="", icon='MESH_MONKEY')

Your second command should also work but in this case you need to manually add execution context and undo flag (to be able to adjust operator settings):

L.operator("pme.exec", text="", icon='MESH_MONKEY').cmd = "bpy.ops.mesh.primitive_monkey_add('EXEC_DEFAULT', True)"

πŸ”— View on Blender Artists