I have a question to python programming. I'm writing PieMenus for my Spacemouse. It's a Syntax Question. I want to use a comand with a action and a true command at the same time.

So I want to build a menu like shown in the picture

enter image description here

But the code for the Extend comand dosen't works. I get the same effect like in select parent.

# Pie Selection Edit Mode
class PieSelections_PM(Menu):
    bl_idname = "pie.selectionspm"
    bl_label = "Pie Selections Pose Mode"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        # 4 - LEFT
        pie.operator("view3d.select_border", text="Border Select",
        # 6 - RIGHT

        pie.operator("pose.select_constraint_target", text="Select Constraint Target", icon='FORCE_CURVE')
        # 2 - BOTTOM
        pie.operator("pose.select_all", text="Select None",
                    icon='RESTRICT_SELECT_ON').action = 'DESELECT'
        # 8 - TOP
        pie.operator("pose.select_all", text="Select All",
                    icon='RESTRICT_SELECT_OFF').action = 'SELECT'
        # 7 - TOP - LEFT

        pie.menu("pie.selection_Parent/Child_Extend_PM", text="Extend Parent Child", icon='LINKED')
        # 9 - TOP - RIGHT
        pie.operator("pose.select_all", text="Invert Selection",
                    icon='FULLSCREEN_EXIT').action = 'INVERT'
        # 1 - BOTTOM - LEFT
        pie.operator("view3d.select_circle", text="Circle Select",
        # 3 - BOTTOM - RIGHT
        #pie.menu("pie.selection_Parent/Child_PM", text="Parent Child", icon='GROUP_BONE')
        box = pie.split().column()        
        box.operator("pose.select_hierarchy", text="Select Parent", icon='ZOOMIN').direction='PARENT'
        box.operator("pose.select_hierarchy", text="Select Child", icon='ZOOMOUT').direction='CHILD'        
        box.operator("pose.select_hierarchy", text="Extend Parent", icon='DISCLOSURE_TRI_RIGHT').direction='PARENT'.extend=True
        box.operator("pose.select_hierarchy", text="Extend Child", icon='DISCLOSURE_TRI_DOWN').direction='CHILD'.extend=True     

The code with I want to change is that one below. How I have to seperate "direction='CHILD'" and "extend=True"?

  • 1
    $\begingroup$ Related $\endgroup$
    – batFINGER
    Jun 15, 2018 at 14:50
  • $\begingroup$ thanks, needed some time to get how it works, but now my code works $\endgroup$
    – M. Matz
    Jun 15, 2018 at 15:21

1 Answer 1


So with the comment I made the following code, which works well:

    #The props= is to get two multiple arguments with one operator.
    props=box.operator("armature.select_hierarchy", text="Extend Parent", icon='DISCLOSURE_TRI_RIGHT')

Not the answer you're looking for? Browse other questions tagged .