Pie Menu Editor 1.18.7

Hello! I’d like to add Edge Crease and Edge Bevel Weight as values into a Pie Menu, which I could drag left and right. At the moment, I only know how to assign the Edge Crease or Bevel Weight as buttons, which take me to into the Modal where I can move my cursor around on the screen to change the value.

Would it be possible to have Edge Crease and Bevel Weight values directly exposed in a Pie Menu so that I can drag left and right or click and enter a value? Thanks!

What code do you use for these buttons?

I’m just using the Commands:

bpy.ops.transform.edge_bevelweight()
bpy.ops.transform.edge_crease()

We don’t have access to these buttons from python. But you can create your own. Add Float Properties with these getter and setter (edge_crease_and_bevel_weight.json):

Edge Bevel Weight Getter:

import bmesh; obj = C.edit_object; me = obj and obj.type == 'MESH' and obj.data; bm = me and bmesh.from_edit_mesh(me); l = me and bm.edges.layers.bevel_weight.verify(); e = me and find_by(bm.edges, "select", True); return e[l] if e else 0

Edge Bevel Weight Setter:

import bmesh; obj = C.edit_object; me = obj and obj.type == 'MESH' and obj.data; bm = me and bmesh.from_edit_mesh(me); l = me and bm.edges.layers.bevel_weight.verify(); me and [e.__setitem__(l, value) for e in bm.edges if e.select]; me and bmesh.update_edit_mesh(me)

Edge Crease Getter:

import bmesh; obj = C.edit_object; me = obj and obj.type == 'MESH' and obj.data; bm = me and bmesh.from_edit_mesh(me); l = me and bm.edges.layers.crease.verify(); e = me and find_by(bm.edges, "select", True); return e[l] if e else 0

Edge Crease Setter:

import bmesh; obj = C.edit_object; me = obj and obj.type == 'MESH' and obj.data; bm = me and bmesh.from_edit_mesh(me); l = me and bm.edges.layers.crease.verify(); me and [e.__setitem__(l, value) for e in bm.edges if e.select]; me and bmesh.update_edit_mesh(me)

You can use these properties in Menu tab.

5 Likes

Hi, sorry if the question was asked already.
How to add a modifier (for example an array) to a modal operator, and change the count?

Hi, here is Modal Subsurf Modifier example (video).
Note that Render Levels sub-hotkey doesn’t redraw Properties area for some reason. That’s why we need to add On Update code to redraw it manually.

Some info about modals in PME.

2 Likes

Any chances fixing those:
image
There is few pages of warning about annotations, from PME on script reload.

Thank you so much :slight_smile:

Yes, I’m going to fix this in the next version.

hello roaoao, have some problems adding buttons by menu. I’m using 1.15.16 and blender 2.8 from last week. this is the message:

I have pie script that looks like:


It is hard to read. Would be cool to have option for bigger command input. Similar to text editor, but I’m not sure if it is possible with blender API.

Pie Menu Editor 1.15.16 fix 1


Thanks, @rhyging5
Here is the fix (26.6 KB)

Extract the files to scripts/addons/pie_menu_editor folder and restart Blender.

Command input is limited to 1024 characters. If you want to write some complex multiline scripts it’s better to use external python scripts. To call addon/pie_menu_editor/scripts/my_python_script.py python script use this code:

execute_script("scripts/my_python_script.py")

Hey,

I would like to put the vertex, edge and face selections in pie menu.
What commands do I have to make so the components selections is work from the level of object and edit mode?

What python command is for toggle wireframe on shaded (in pie menu)?

Is possible to recreate this function from ReLast addon (https://youtu.be/JfvLlfOgaSw)
in PME? I try with the same way as Subdivide (modal operator) in your tutorial but is not working.

Blender 2.8

Thank You!

@roaoao Is it possible to have more than one context-sensitive menu set up? As it stands, it looks like there can be only one object named ‘mesh’ ‘none object’ etc. If I try to create another one, the addon renames it as ‘mesh.001’ and so on. In the youtube tutorial video under your channel, it shows that the add on is capable of organizing multiple mesh and none object as categories.

So many thanks :slight_smile:

BTW just as sugestion, would be possible to add some subtle margin in pop-ups menus? Is only a generic sugestion about style. I attaching a skecth:

Did you tried to increase the width in the setting ?
blender_0iKInSd0KS

Here is an example for the vertex mode:

C.tool_settings.mesh_select_mode = (True, False, False)

Try something like this in Command tab:

s = C.space_data.shading; s.type = 'WIREFRAME' if s.type != 'WIREFRAME' else 'SOLID'

Yes, import this Grid Fill Modal and use it in your pie (Menu tab).

1 Like

Sure, you need to modify the example code.
What code do you use in that menu? It was modified several times. I don’t remember what code was used in that youtube video.

Thank You very much for help. Grid Fill works great!
For wireframe on shaded i mean:

https://imgur.com/a/uH0hmNq