Pie Menu Editor 1.18.7

Thanks, will fix in the next version. Meanwhile you can set pie menu’s Animation Timeout (User Preferences - Interface tab) to 0.

Please let me know if you find a way to reproduce this.

Grayed out button means that the button can’t be used in the current area or mode. Try to use it in Image Editor area.

Undo_redo operator works only for active operators. To make an operator active, you need to call it with True positional argument. For example bpy.ops.mesh.subdivide(True).

So, to change smoothness of the active operator in python, you need to use this code:

C.active_operator.smoothness = 0.2; bpy.ops.ed.undo_redo(True)

Note that undo_redo operator should always be called with True positional argument.

The tool you want to create is complex but doable if we add some extra variables.
Video and json file: unsubdivide_subdivide.zip (740 Bytes).

Note that:

  1. We can’t use Mouse Move sub-hotkey with other sub-hotkeys in modals. That’s why I’ve used alt+LMB sub-hotkey to change strength of the tool.
  2. Key modifier is important in this case. You are using alt+W hotkey for this tool. So you have to use the same key modifier (alt) for all sub-hotkeys.
  3. The position of OnUpdate slots is important. In this case 6 OnUpdate slots are registered for the Tool sub-hotkey and only 1 for Smoothness sub-hotkey.

I know 2.8 is still in development but I’m wanting to play around with it, however I’m getting this error:


I’m using the latest 2.8 build (blender-2.80-46bfdb4-win64.zip Apr 25 2018 16:48:31)

Thanks, here is the fix - pme1.14.15_fix_overlay.py.zip (4.02 KB). Extract the file to scripts/addons/pie_menu_editor folder and restart Blender.

Thanks for the tool example! That’s far more complex that what I was trying, haha.
Good tip about the Alt, too.

As for the greyed out button: that’s true, but can I not force run the command regardless of location, or momentarily switch to the required mode, or trick it into thinking it is?

Yes, you can use some operators in any screen/area if you override the context.
For example:

bpy.ops.console.clear(override_context('CONSOLE', "Scripting"))

Where ‘CONSOLE’ is a type of the area and “Scripting” is a screen name with that area.
You can find more info about override_context() function in pie_menu_editor/scripts/autorun/functions.py.

Works now roaoao! Thanks :smiley:

I’d like to request a feature to search for a menu by names, editor types, hotkeys beside using tags.

I’ve been wanting that since I first got PME, but I didn’t want to cause roaoao any trouble haha Also wanted PME to save which tree groups were open and closed :stuck_out_tongue:

Good features. Will add them in the next version.

Same here for both actually. Thanks for asking it Anphung, and considering it, Roaoa.

Btw, is there a repository of user submitted PME tools yet?

Don’t think so. But I’d love one. Quite proud of what I’ve made in PME. :slight_smile:
Also would be nice to see other users’ menus, and borrow some of those, especially them macros and modals.

Maybe we could create a discord server for PME, and share our menus on there? I’d want roaoa to create it so he’d be in control, but seems like a good idea to me.

@roaoao: as per my request of a different way to select an axis, could you take only that specific code out of another addon? I found this one, for instance: https://blenderartists.org/forum/showthread.php?419179-ADDON-Advanced-Transform&highlight=
It does what I want, but then uses its own modals for translate/rotate/scale, and I don’t want that.

There is Examples page (will update it soon). Also jakro and Stroblend shared their scripts and menus.
If you want to share your menus you can export and pm me them. Or just upload them somewhere and post the link here.

Thanks for the link. Hmm, yes, looks like we can use Modal Operator editor to create these tools. Will send you an example tomorrow.

Hey!

First of all I would like to thank Roaoao for developing this game changing addon! I’m pretty much handicapped without it, since I started to dig deeper into all the possibilities it brings to the table!

PME has also given me opportunity to finally start to learn python and my first try is an quickSelection pie, that a TD made for me in my Maya days. With it, I could easily switch between objects and rigs for characters with mouse gestures(marking menu/pie menu).

So I have been melting my brain with probably the simplest code in python, to replace objects within a specific group, with an active object.

I have gone through some tutorials and the API, but for the life of me, my brain cannot seem to grasp the logic behind this?

So for example, I would like to replace the ‘Green’ cube for the ‘Red’ and ‘Blue’ cubes in group called ‘sel_N’.


This is where I’m at, which is surely a total mumbo jumbo, but I’ve learned allot through this process. :slight_smile:


import bpy

to_deselect = []
selected = bpy.context.selected_objects
active = bpy.context.active_object


for ob in bpy.data.groups['sel_N'].objects:
    ob.select = True
    to_deselect.append(ob)

print(active.name)

I would really appreciate if someone here is willing to share their python wisdom to help me out with this? :slight_smile:

Also, I was wondering if it’s possible in PME, to use the 'PMIItem.label" in the code? So the code would use the label name as an reference for naming a ‘Group’?

Cheers! :slight_smile:

Nope, I was wrong, those tools are too complex for Modal editor.

Hi, I forgot something or I don´t know… how can I add a modifier with the settings that I want?? We could do this, couldn´t we?? Feeling a bit lost… I want to add a stack key for adding wireframe modifier and then bevel modifier.


I would just do it this way:

import bpy
# loop through selected objects
for obj in bpy.context.selected_objects:
    bpy.context.scene.objects.active = obj
    
    # add wireframe and bevel modifiers
    obj.modifiers.new("MyWireframe", type = "WIREFRAME")
    obj.modifiers.new("MyBevel", type = "BEVEL")
    # change parameters
    bpy.context.object.modifiers["MyBevel"].segments = 4

It works for a whole selection then and you can just add as many parameter changes as you want :slight_smile:
Just run it in PME as an external script and you are good to go.

Thanks @Way2closem it works like a charm!!

@bjarkirafn, I would love to help, but I don’t understand what you are trying to achieve sorry. Is it something like this: