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!
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)
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.
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.
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:
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.
@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.
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.