Pie Menu Editor 1.18.7

Thanks! Glad you like the menu, although I’ve already changed a lot in the mean time. Like a ZBrush custom UI, the tweaking is never finished. :slightly_smiling_face:

The add-ons needed for all functions in this menu are (in alphabetical order):

  • EdgeFlow for Set Edge Flow.
  • Looptools (ships with Blender) for Gstretch, Flatten, Circle and Relax.
  • Mesh Fairing for Fair Vertices (make sure you install SciPy from the Blender Preferences for faster operation).
  • Miratools (part of Mifthtools) for Deformer, LinearDeformer and CurveGuide.
  • Volume Preserving Smoothing [$] for Volume Smoothing.

Now it shows settings in addon UI, but didn’t in ‘F9’ panel


How to create pie menu that works only in edit mode?

@roaoao
Thanks again for your addon and for the precious help you give to users.

Currently, I have a pie menu that allows me to toggle on/off the “auto depth” selection mode. It uses the “C.preferences.inputs.use_mouse_depth_navigate” property.

image

I would like every time I toggle on “auto depth” to also activate the “zoom to mouse” option and desactivate it when auto depth is off while keeping the visual feedback showing if “auto depth” is engaged.
Is there a solution?

Hi, you can take a look at the documentation property editor video should answer your question

Thanks,
I will have a look at it. I never used property editor.

edit: That was the solution. Everything works as expected now.

1 Like

Sorry for the late reply.
To set active layer by name use this code:

C.object.data.layers.active = C.object.data.layers['Fill Layer']

To set active material by name you can use this:

C.object.active_material_index = C.object.material_slots.find('Fill Material')

So you need a stack key (not a macro) with 2 slots:
Fill:

C.object.data.layers.active = C.object.data.layers['Fill Layer']; C.object.active_material_index = C.object.material_slots.find('Fill Material')

Line:

C.object.data.layers.active = C.object.data.layers['Line Layer']; C.object.active_material_index = C.object.material_slots.find('Line Material')
2 Likes

You can use C.window.cursor_warp(x, y) to move the mouse and call a pie with some delay using pme.timeout operator.
Eg. call the pie in the center of 3DView:

a = find_by(C.screen.areas, "ui_type", 'VIEW_3D'); a and C.window.cursor_warp(a.x + a.width / 2, a.y + a.height / 2); a and bpy.ops.pme.timeout(cmd="open_menu('Pie Menu')")

To open the pie in the center of screen use this:

w = C.window; C.window.cursor_warp(w.width / 2, w.height / 2); bpy.ops.pme.timeout(cmd="open_menu('Pie Menu')")
4 Likes

Looks like a little bug here. Will fix in the next version.
Add , True here:

bpy.ops.mira.make_arc('INVOKE_DEFAULT', True)

Or remove 'INVOKE_DEFAULT' (when you use 1 operator in the editor PME adds 'INVOKE_DEFAULT', True automaticaly):

bpy.ops.mira.make_arc()

Do you mean mesh edit mode?
Select Mesh as a keymap.

2 Likes

No problem on the late reply, I’m just glad to make progress where i would have been stuck otherwise. With the Shadow Layer/Material, if I wanted to toggle the shadow layer and material to whatever the last layer and material was, how would I do that?

Thank you!
I restrict pie menu to the edit mode, so now i can use just

bpy.ops.mira.make_arc()

Is the way to create a toggle, for smooth/flat shading in one pie item
This way it working only for meshes, but not for curves

bpy.ops.object.shade_flat() if bpy.context.object.data.polygons[0].use_smooth else bpy.ops.object.shade_smooth()

And this for no one

bpy.ops.object.shade_flat() if bpy.context.object.data.polygons[0].use_smooth or bpy.context.object.data.splines[0].use_smooth else bpy.ops.object.shade_smooth()

No need a stack key in this case. Just use this code in Command tab:

layer = "Shadow Layer"; mat = "Shadow Material"; G = pme.context.globals; prev_layer = G.setdefault("prev_layer", None); prev_mat = G.setdefault("prev_mat", None); active_layer = C.object.data.layers.active.info; active_mat = C.object.active_material.name; layer = prev_layer if layer == active_layer else layer; mat = prev_mat if mat == active_mat else mat; G.update(prev_layer=active_layer); G.update(prev_mat=active_mat); C.object.data.layers.active = C.object.data.layers[layer]; C.object.active_material_index = C.object.material_slots.find(mat)
2 Likes

Try to use bpy.ops.curve.shade_smooth() and bpy.ops.curve.shade_flat() instead.

2 Likes

Thanks for your help.

This is what i’m talking about

import bpy

if bpy.context.object.type == 'MESH':
    
    if bpy.context.object.data.polygons[0].use_smooth :
    
        bpy.ops.object.shade_flat()    
    else:
    
        bpy.ops.object.shade_smooth()
        
elif bpy.context.object.type == 'CURVE':
    
    if bpy.context.object.data.splines[0].use_smooth :
    
        bpy.ops.object.shade_flat()    
    else:
    
        bpy.ops.object.shade_smooth()

I put it in external script, and now when i pressing hotkey for pie, the script executes and also there is no button :woozy_face:


By the way Is it possible to write it as a command?
UPD: solved execute_script was in custom tab :slight_smile:

@roaoao
is it possible to change the hotkey 1-8 to a custom hotkey inside the pie menu item?
e.g.: by default the hotkey for the pie on the right is 6. Could I change it to W?

Best regards,
Fred

1 Like

We can’t replace 6 hotkey afaik. But we can add W hotkey by using the letter in item’s label.
Eg: (W) My Button.

4 Likes

Nice! That’s very cool, didn’t know that.
Thanks for the info. :love_you_gesture:

Is there is a way to add this sub-panel as a Popup Panel in a pie menu ?

image

( just the Item>Transform part )

I’ve tried all the Transform and Data panel without success.

Thanks

I’m not sure if this is what you need but try using this custom code in a Popup Dialog

panel('OBJECT_PT_transform', frame=False, header=False, expand=None, area='PROPERTIES'); L.separator() ;col = L.column(align=True); col.use_property_split=True; col.prop(C.object, "dimensions") 

Then you can just add it as a menu

Thank you, but it doesn’t seem to work, whether I use it directly as a popup or in a pie menu.