Pie Menu Help?


(heavypoly) #1

Hi all, I have a simple view pie menu here, but having trouble getting align_active = True to work. Any ideas?
Thanks, Vaughan

class VIEW3D_PIE_View(Menu):
bl_idname = “pie.view”
bl_label = “View”

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

    pie = layout.menu_pie()
    # operator_enum will just spread all available options
    # for the type enum of the operator on the pie
    # left
    pie.operator("VIEW3D_OT_viewnumpad", text="Left").type = "LEFT"
    # right
    pie.operator("VIEW3D_OT_viewnumpad", text="Right").type = "RIGHT"
    # bottom
    pie.operator("VIEW3D_OT_viewnumpad", text="Bottom").type = "BOTTOM"
    # top
    pie.operator("VIEW3D_OT_viewnumpad", text="Top").type = "TOP"
    # topleft
    pie.operator("VIEW3D_OT_viewnumpad", text="Back").type = "FRONT"
    # topright
    pie.operator("VIEW3D_OT_viewnumpad", text="Camera").type = "CAMERA"
    # bottomleft
    pie.operator("VIEW3D_OT_viewnumpad", text="Align To Selected").type = "TOP", .align_active=True)


    # bottomright
    pie.operator("VIEW3D_OT_viewnumpad", text="Front").type = "BACK"