Pie Menu Editor 1.18.0

Hi roaoao
I am trying to create a setup that will be able to open and close the “popup_area” window in my case it is outliner window.
I use the “Stack Key” module to open popup window, and at this point I have 2 questions:

  1. Is there a parameter that will keep the window at the top all the time?
  2. To close the window, I’m trying to use the same module but limited to the “Outliner” window, which performs the default keystroke shortcut for closing windows, “alt + f4”, but this solution does not work.
    maybe some advice on that? Thx

Install is easy, It’s getting the pie’s to right click. how do I bind PME to RMB?

Popupdialog

How do you add just Text to a popup dialog?

Blender doesn’t support this. Check your window manager features. You can rules for windows in some of them.

Unfortunately, we can’t close windows by using Blender API.
Some other notes:

  • PME support only Blender hotkeys in Hotkey tab. That’s why Alt+F4 doesn’t work.
  • You have 2 stack keys with 1 slot. But in most cases you need to use 1 stack key with 2 slots.
2 Likes

What do you mean? You want to create a pie menu and bind it to RMB?
Here is an example. But instead of Q press RMB.

1 Like

Use this code in Custom tab. It will display slot name as a text:

L.label(text=slot, icon=icon, icon_value=icon_value)
2 Likes

@roaoao,

Hi, I just wanted to share a workaround a fellow forum member cooked up for me. I thought about posting this in a separate forum thread, but I am not sure how useful others will find it to be since it’s pretty “edge casey”.

I use VS Code with Blender Development extension, and I have been using it to reload my Blender add-on so that I can quickly test changes to my add-on. I’ve been creating compact versions of my panels so that they can be comfortably used with PME.

However, up until 2 days ago, everything was working fine. I could reload my blender add-on using VS Code, and the pie menu keymaps would work fine. Now, the keymaps just disappear whenever I reload my add-on from VS Code using Blender Development Extension. Not sure if there’s a problem with my Blender Config, my add-on, or my PME configuration/keymaps

In any case, forum member iceythe cooked up this script and it resolved my problem nicely.

bDebugModeActive = True

def _reg():
   pme = bpy.utils._preferences.addons['pie_menu_editor'].preferences
   for pm in pme.pie_menus:
       if pm.key != 'NONE':
           pm.register_hotkey()

Then, appended to the register() function (supposedly critical that it is below all of my other register stuff)

if bDebugModeActive:
    if not bpy.app.timers.is_registered(_reg):
        bpy.app.timers.register(_reg, first_interval=1)

So, I guess the way it works is, it re-register’s PME’s keymaps whenever I perform a reload from VS Code using Blender Development extension.

Anywho, just thought I’d pass this along because I don’t know if others have run into this issue before, but it is particularly useful for add-on developers when trying to make sure their add-on panels look a certain way when they are inside of a PME created pie menu or popup. Perhaps there is something you can change or add to PME to ensure better interoperability with Blender Development extension? :slight_smile:

As always, love your add-ons, and appreciate all of the hard work you put into them.

@roaoao, What would be command to replace environment texture in the world shader? Command recorded with ‘Debug Mode’ just opens a file, but the texture itself does not get changed this way.
Also, is it possible to change rotation of a texture via Mapping Node with modal operator?

@roaoao, I’m trying to add the ‘Eye’ button to my custom toolbar bar as a Property (button that changes state/ icon like in the PMEditor) but I can only add it as a command. Could you show me the code for that? Thank you.

Where I can find them? Please post some screenshot

1 Like

Try this code in Custom tab:

pm_name = "Freeze & Export FBX"; slot_name = "Remove Material Slot"; pm = prefs().pie_menus[pm_name]; slot_idx = pm.pmis.find(slot_name); slot = pm.pmis[slot_idx]; operator(L, "pme.pmi_toggle", "", 'HIDE_OFF' if slot.enabled else 'HIDE_ON', pm=pm.name, pmi=slot_idx, depress=slot.enabled)
3 Likes
Summary

https://media.blenderartists.org/uploads/default/original/4X/8/f/d/8fdc68c22876e72f2a9f7908398fcc4773bad7f4.ogv

Try this code:

C.world.node_tree.nodes["Environment Texture"].image = D.images["Texture"]

Yes, use this path for Property modal slot:

C.world.node_tree.nodes["Mapping"].inputs[2].default_value[0]
3 Likes

The first one works fine, I’ll try the second one later on as I have never used modal operators so far and need to practice a bit first.
Thank you!

is it possible to tell if the selection is for vertex or edge in mesh mode?
for example, with the same short cut key, I may want to slide a vert in “vert mode” or slide edge in “edge mode”.

When I click on the ‘Wire’ item in the Display as dropdown while holding Alt, it applies to multiple objects at once, could you show me how to translate that to a command? I assume a ‘for’ loop would be the way, but I’ve no idea how to do it. Thank you, @roaoao
bpy.context.object.display_type = ‘WIRE’
image

Yes, check C.tool_settings.mesh_select_mode value:

  • Vert mode: C.tool_settings.mesh_select_mode[0] == True
  • Edge mode: C.tool_settings.mesh_select_mode[1] == True
  • Face mode: C.tool_settings.mesh_select_mode[2] == True

Try this code in Command tab:

bpy.ops.transform.vert_slide('INVOKE_DEFAULT', True) if C.tool_settings.mesh_select_mode[0] else bpy.ops.transform.edge_slide('INVOKE_DEFAULT', True)
3 Likes

Yes, you can check E.alt == True value in Command tab:

setattr(C.object, "display_type", 'WIRE') if E.alt == False else [setattr(obj, "display_type", 'WIRE') for obj in C.selected_objects]
3 Likes

I want to scale while slide edge
Is there any way to run Edge Slide and Scale at the same time = Modal Operator ? :thinking:

Exam: How to Pinch/Scale uniformly with an edge constraint (Blender 2.8) (first gif picture)

wow. Can you share that pie menu?