The mesh hide has two options, hide selected or hide non selected. So you need two buttons, but could it be possible to simply call the pie menu and then with an addition button pressed lets say RMB execute the other options?

this would be like this:

Shift+Alt+ RMB calls the Pie menu

LMB executes hide selected MBB executes hide unselected

enter image description here

I've found an answer on this, but it still need some coding

Standard Pie Menu looks like this:

class PieMenuClass(Menu):
    bl_idname = "pie.pie_menu_class"
    bl_label = ""

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


        pie.operator("mesh.subdivide", text="Subdivide")
        ...

This Pie adds a subdivide operator. Let's say we add more two options - unsubdivide while holding "Shift" and Smooth subdivide with CTRL pressed.

First add register!!! =) one more class:

class MYSubdivide(Operator):
    bl_idname = "class.my_subdivide"
    bl_label = "Ctrl - unsubdivide, Shift - Smooth"


    def invoke(self,context,event):
        if event.shift:
            bpy.ops.mesh.subdivide(smoothness = 1)
        elif event.alt:
            bpy.ops.mesh.unsubdivide()
        elif event.ctrl:
                bpy.ops.mesh.subdivide_edgering(number_cuts =1)
        else:
            bpy.ops.mesh.subdivide()


        return {'FINISHED'}

First declaration then changed to call this class:

class PieMenuClass(Menu):
    bl_idname = "pie.pie_menu_class"
    bl_label = ""

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


        pie.operator("class.my_subdivide", text="Subdivide")

The only problem is that after using this method it's impossible for me to use REDO LAST function F6 ==(( steel need a solution.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.