Post #4818: Hi, I was wondering if there’s a way to execute a script in the pie menu editor

📋 Metadata

  • Author: Dangry
  • Date: 2023-08-09 21:52:08
  • Type: question
  • Quality Score: 7/10

🏷️ Tags

macro pie-menu scripting intermediate unsolved

  • Macro Editor
  • Pie Menu Editor
  • Python Scripting

💬 Content

Hi, I was wondering if there’s a way to execute a script in the pie menu editor in a similar way the macro operation does it. For instance if I add a cube in a macro operation it will show a popup menu when it’s executed.
image

Whereas when the exact same script is executed with a script in a macro it does not show any menu at all?
image
The script:

bpy.ops.mesh.primitive_cube_add()

Also how do you do it for longer scripts when trying to replicate a macro, for instance if I make a macro where the first one is selected linked pick and the other is poke it will create a menu where both menus is merge with all the properties for both operations.

imageimage1110×853 148 KB

Trying to remake this in a script yet again it does not show any menu at all.

bpy.ops.mesh.select_linked_pick('INVOKE_DEFAULT') 
bpy.ops.mesh.poke('INVOKE_DEFAULT')

🔗 View on Blender Artists