Pie Menu Editor 1.18.4

That custom tab works perfectly if i tweak it. I’m using it to make a quick material set up menu that handles shader creation, flipping green channel options ect :slight_smile:

I used this code.

L.template_ID(bpy.context.object.active_material.node_tree.nodes['Image Texture'], "image", new="image.new", open="image.open")

@roaoao Is it possible for stack key to recognize an item’s status like a toggle? I made a stack key to emulate Maya’s smooth preview toggle that examines the object’s subdivision modifier and applies it if there is none, and vice versa. Currently, it does not communicate with the status of the object, so while usable, there is some redundancy.

Yes, I think it’s possible. But to make sure please export and pm me this stack key.

Here is a example of a move, scale, rotate behavior in Nvil. Basically, it detects the axis depending on the view angle. No need to press x,y,z:)
On the top left corner of the video, you can see the hotkeys i use to achieve different behavior.

2 Likes

Here’s a video I made ages ago, I’m afraid the sound’s pretty awful:


Maybe @Woolfy13’s example is better

The difference with Blender’s system is that in Blender you hold mmb within a rotation/translation/scale tool, you get these three axis’ you can move your mouse over, and that selects an axis. But it’s much more prone to failure, and in my experience a lot less quick.
I also set up Q to toggle manipulators on and off, but holding Q puts me in a tool where I can move (and snap) the working manipulator (so, your 3d cursor in Blender)
Hitting and releasing W turns on my move manipulator, but holding W has other options. W+lmb is tweak (with a selection, clicking and dragging anywhere moves those selected components, without a selection you can move the highlight-selected components!), w+rmb is the aforementioned tool that moves on an axis, and w+mmb moves along a plane (so x+y etc.)
I also set w+mb4 and mb5 (the side buttons on a lot of mice) to move along normal and move along the mesh (so like G+G in Blender). It’s an incredibly useful way to work and I miss it so much :smiley:

1 Like

Yes this mmb behavior of blender is much less effective, especially with rotation. Blender should be able to first select/lock axis depend on the view before you move and not after. I mean it mostly covered by the [ADDON] Advanced Transform. But i would like to create my own tool using pie menu editor, for example to customize the rotation step angle(not sure if possible). And of course possibility to create other tools based on this feature inside pie menu editor( since it is much more then only pie creator :slight_smile: )

1 Like

@roaoao Another example I found of my Extrude tool:


Again, the volume is very low, but I’m extruding based on the axis that my mouse movement (the first few pixels) most closedly aligns to.
In practice this is almost always correct, it’s most difficult for the axis that you’re looking along, but that’s equally true for Blender’s MMB selector)
2 Likes

@Michael_Knubben, @Woolfy13, thanks for the examples :+1:
It seems that these tools can be implemented by using existing Blender and PME features (plus some helper python functions).
Will try to do that and post some examples this week.

3 Likes

@roaoao Is it possible to toggle the icon of a pie menu item depending on the mode? Say a toggle between object and edit mode.

1 Like

I am trying to create a Macro that adds a Bevel Modifier with certain settings, and then adds a Weighted Normal Modifier. However, it seems as if adding multiple modifiers doesn’t work. The Macro will only add the last modifier in the list.

Edit: I guess the workaround is to use the Harden Normals on the Bevel Modifier instead of adding the Weighted Normals. I am encountering another issue though. Sometimes the buttons in my Pie Menus seem to be changing places or disappearing. Is it known why this could be happening?

Yes, you can use Custom tab for this:

L.operator("object.editmode_toggle", text="Object Mode" if C.mode == 'OBJECT' else "Edit Mode", icon='OBJECT_DATAMODE' if C.mode == 'OBJECT' else 'EDITMODE_HLT')

You can find and copy icon names in Icon Viewer add-on (Settings - Add-ons - Development category - Icon Viewer)
Here is a list of functions you can use in Custom tab.

Yep, macros don’t support multiple operators with the same ID (object.modifier_add in your case).
There is a workaround in PME. Just put the code in parentheses:

(bpy.ops.object.modifier_add(type='BEVEL'))

This can happen if a pie has errors in Custom tab. Can you export and pm me the pie?

1 Like

Hey @roaoao, I have to ask how to do this after trying for a whole day. I’m trying to create a toggle button for GroupPro’s Close and Edit function. Would you happen to know a thing about this?

Hi, @roaoao, recent files from custom table example don’t show in pie menu. How to fix that?

Wonderful! Thanks so much.

Looks like recent files menu was renamed. Use this code instead (Custom tab):

L.menu('TOPBAR_MT_file_open_recent', text=text, icon=icon, icon_value=icon_value)
1 Like

Thank you!

Thanks from me too!

How do I create a pie menu item that toggles between these two tool settings? Currently, trying to discern when to use operator vs l.prop or what not is very difficult.

bpy.context.scene.tool_settings.transform_pivot_point = ‘CURSOR’
bpy.context.scene.tool_settings.transform_pivot_point = ‘BOUNDING_BOX_CENTER’

In this case you can use Command tab:

ts = C.scene.tool_settings; ts.transform_pivot_point = 'CURSOR' if ts.transform_pivot_point != 'CURSOR' else 'BOUNDING_BOX_CENTER'

If you want to change text and icon of the button depending on pivot point mode you need to use L.operator() function in Custom tab:

ts = C.scene.tool_settings; L.operator("pme.exec", text="Cursor" if ts.transform_pivot_point == 'CURSOR' else "Box", icon='PIVOT_CURSOR' if ts.transform_pivot_point == 'CURSOR' else 'PIVOT_BOUNDBOX').cmd = "ts = C.scene.tool_settings; ts.transform_pivot_point = 'CURSOR' if ts.transform_pivot_point != 'CURSOR' else 'BOUNDING_BOX_CENTER'"

L.operator(...) function shows basic clickable button with customizable action.

L.prop() function shows widgets depending on the property type:

  • Boolean Property - check box or toggle button
  • Enum Property (your case) - drop down list or radio buttons
  • Int or Float Property - number input field or slider
  • String Property - text input field
4 Likes