What would be the nicest way to code(in Python) a pie menu in Blender 2.79 or 2.8, that would have another menu as an addition to the standard 8 pie menu choices?

After playing with it for some time I found that this kind of works:

import bpy

def draw(self, context):
layout = self.layout
pie.separator()
pie.separator()
gap = pie.column()
gap.separator()
gap.separator()
gap.separator()
gap.separator()
gap.separator()
gap.separator()
gap.separator()

def register():
bpy.utils.register_class(VIEW3D_PIE_template)

def unregister():
bpy.utils.unregister_class(VIEW3D_PIE_template)

if __name__ == "__main__":
register()



I wonder if there is a nicer way. This feels 'hacky' and it would be nice to have a menu that would have expandable sub-menus if that is possible at all. I realize that might be too much to wish for... Any advice?

• You can just append another menu as a submenu: How to make a sub-menu with Python?, with some formatting it could look like this: pastebin.com/7d8dzpwi. You can also do fully custom stuff with bgl drawing inside modal operator, but you would have to re-implement the pie menu functionality. – Jaroslav Jerryno Novotny Nov 13 '18 at 8:02
• Thank you! That really helps. That's all the functionality I wanted. I am still hesitating a bit about the code now - I mean all the separators to go around the pie menu... But it works, so I really appreciate the help. – Martynas Žiemys Nov 13 '18 at 8:25
• You can just leave 2 separators there and scale the gap column with gap.scale_y = 5.0 to create the distance, but this could mess with spacing of anything put after the gap.box() item in the column. So multiple separators are imho the best to make the space, I would not worry about it. You can add some comments in the code to make it feel less hacky, like # spacing between pie and column menu followed by the separators. – Jaroslav Jerryno Novotny Nov 13 '18 at 9:11
• .... putting the separators in a for loop or a draw_gap(self, layout, count=7): method will "clean" the code up somewhat. – batFINGER Nov 13 '18 at 9:15
• I am just scaling a column with one separator with .scale_y now for the gap. That seems nicer. Other than that I need two separators to start drawing my additional 'menu' at the correct place of the pie menu. I think that will have to be nice enough. – Martynas Žiemys Nov 13 '18 at 9:46

The solution I ended up with is the same as discussed in the comments:

import bpy

def draw(self, context):
layout = self.layout
layout.separator()

def draw(self, context):
layout = self.layout
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.operator("mesh.primitive_cube_add", text = "Some Operator", icon = "BLENDER")
pie.separator()
pie.separator()
other = pie.column()
gap = other.column()
gap.separator()
gap.scale_y = 7

def register():

def unregister():

• hello, is it normal to have Warning: Pie menus with more than 8 items are currently unsupportedthis error message printing every time i call the pie ? – DB3D Jun 28 '19 at 19:55