Pie Menu Editor 1.18.7

Is it possible to make execute path a little bit more flexible? Something like this


execute_script("<i>os.path.join(os.environ['ONEDRIVE'], </i>"Code/addons/addon.py"<i>)</i>")


 

Hi, check the code. Try to remove double quotes:

execute_script(<i>os.path.join(os.environ['ONEDRIVE'], </i>"Code/addons/addon.py"<i>)</i>)

I forgot to change addon.py to actual name ā€” a whole hour wasted :spin: what a shame lol

execute_script(os.path.join(os.environ['ONEDRIVE'], "Code", "addons", "addon.py"))

edited slightly, to be sure that the path is correct, now it works perfectly!) thank you roaoao!

Hey roaroao, seems this add-on doesnā€™t with blender 2.8 version, isnā€™t it? When we can wait a properly version? :spin:

Hi, PME 1.14.15 works for me in 2.8. Maybe Iā€™m missing something?

Iā€™m going to release PME 1.15.0 with new features this week. So please let me know if you find Blender 2.8 related issues. Iā€™ll try to fix them for upcoming version.

Btw, please keep in mind that 2.8 version is still in development. Any small change can break the addon.

Good morning roaoao,

sorry for the confusion, was something about the keymap configuration, not about the add-on :slight_smile: it works in 2.8 for me too

HI,

Would like to have separate Pie menus for the different Node Editors. Tex, Comp, Material and if possible Animation Nodes. Material Node Editor working fine, however, it also shows in Tex, Comp, Ani Nodes. What is Generic Node for? Thanks


Should be something like this I think

if bpy.context.space_data.tree_type == ā€˜ShaderNodeTreeā€™:
open_menu(ā€œmenu_1ā€)
elif bpy.context.space_data.tree_type == ā€˜CompositorNodeTreeā€™:
open_menu(ā€œmenu_2ā€)
elif bpy.context.space_data.tree_type == ā€˜TextureNodeTreeā€™:
open_menu(ā€œmenu_3ā€)

cant find the animation one, but I never use nodes

Use Node Editor keymap with one of these poll methods:

return C.space_data.tree_type == 'ShaderNodeTree'
return C.space_data.tree_type == 'TextureNodeTree'
return C.space_data.tree_type == 'CompositorNodeTree'
return C.space_data.tree_type == 'an_AnimationNodeTree'

Way2Close and roaoao.

Thanks I give it a try. is elif sort for else if?

Yes lol, it didnt paste it right, the lines should be indented:


if bpy.context.space_data.tree_type == 'ShaderNodeTree':
    open_menu("menu_1") 
elif bpy.context.space_data.tree_type == 'CompositorNodeTree':
    open_menu("menu_2") 
elif bpy.context.space_data.tree_type == 'TextureNodeTree':
    open_menu("menu_3")

Iā€™ve been trying to follow along with the context sensitive pie menu video, but iā€™m having trouble setting up a context sensitive menu.
Can anyone point me in the right direction?

Hi, thanks, Iā€™ll update the video.
To create a context sensitive menu you need to use poll method. You can find an example here or here.

Hey roaoao,

Iā€™m trying to set up a Modal for editing Wondermesh properties. How can I have regular mouse-movement control C.object.data.WBox.size_x, C.object.data.WBox.size_y and C.object.data.WBox.size_z at the same time, keeping their relative values (so if the values are x=2, y=3 and z=5 when entering the modal, moving my mouse will add or subtract 1 from each of these)?
On top of that, Iā€™d still want to have three seperate hotkeys within the modal that let me tweak each value alone (say, q, w and e)
As a last request, Iā€™d like to tweak another three values together, with the mousewheel.

Iā€™d want to set this up similarly for all of the different Wondermesh primitives, so if I could detect the name and fire off a different modal based on whether itā€™s WTube, Wbox_01 etc, thatā€™d be great!

edit: additionally, Iā€™ve been hoping to find a way to do this:
Use the mouse-path over a few pixels to determine between different commands. For instance, when I move my mouse a few pixels up, compare to closest world (or local) coordinate (x, y or z) and initiate a grab locked to this axis. Nvil/Voidworldā€™s move/rotate/scale functioned like this, and it was much nicer than Blenderā€™s MMB axis selector.

Hey, just checking, is it normal to have this:

module changed on disk: C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\pie_menu_editor_init_.py reloadingā€¦

in the console on startup?

Will send you an example tomorrow.

These tools (nvilā€™s move/rotate/scale) require a lot of code. Itā€™s better to create a separate add-on for them. Canā€™t help you with it (good 3d math skills are required).

Hi, Iā€™m not sure how/where Blender stores module states, but try to save user preferences and restart Blender.

@roaoa:
Iā€™ve figured it out with the help of some friends, although Iā€™m still not clear about the synthax required for some other stuff Iā€™m attempting. Is there any more documentation coming?

Iā€™ll also share my menus soon, although theyā€™d need some cleaning up.

For instance: How can I get the ā€˜Smoothnessā€™ control on the mousewheel to function in the following Modal:

{
ā€œversionā€: ā€œ1.14.15ā€,
ā€œmenusā€: [
[
ā€œSubdivide / Unsubdivideā€,
ā€œMeshā€,
ā€œalt+Wā€,
[
[
ā€œOn Invokeā€,
ā€œINVOKEā€,
ā€œā€,
ā€œdelta = 0; bpy.ops.mesh.subdivide()ā€
],
[
ā€œSmoothnessā€,
ā€œPROPā€,
ā€œWHEELUPMOUSE;;;0.10000000149011612;ā€,
ā€œC.active_operator.smoothnessā€
],
[
ā€œDeltaā€,
ā€œPROPā€,
ā€œMOUSEMOVE;-10.0;10.0;;ā€,
ā€œdeltaā€
],
[
ā€œSubdivide / unsubdivideā€,
ā€œUPDATEā€,
ā€œā€,
ā€œbpy.ops.mesh.unsubdivide() if delta <0 else bpy.ops.mesh.subdivide(smoothness=0.0); delta = 0ā€
],
[
ā€œMake Normals Consistentā€,
ā€œFINISHā€,
ā€œā€,
ā€œbpy.ops.mesh.normals_make_consistent(inside=False)ā€
]
],
ā€œMODALā€,
ā€œmo?confirm=Trueā€,
ā€œPRESSā€,
ā€œā€,
ā€œā€
]
]
}

Yes, but after PME 1.15.0 release.
Make sure that you checked this page and this video.

Iā€™m using ctrl+mousewheel to control the smoothness in

. Note that to apply modified properties of the active operator (smoothness in this case) we need to call bpy.ops.ed.undo_redo(True) operator. Also note that the position of On Update slot is important.

But you want to control both tools (subdivide and unsubdivide) with mousewheel. Right?

Here is an example (json file - add_cone_modal.zip (543 Bytes) and video).
I donā€™t have Wondermesh add-on so Iā€™ve used Add Cone tool.

I think Iā€™ve found a bug:
When I set a pie to have a specific radius in itā€™s settings, and then open another (non-PME) pie menu, it inherits the radius, rather than take it from Blenderā€™s settings.
Moving the viewport a bit resets it, but not always!

Thereā€™s also another problem Iā€™ve been having where Debug Mode will get enabled, and every click I make in the PME interface will pop up the debug menu (where you add something to the current Pie). Only a full restart of Blender (so not just a new file) fixes this, and I havenā€™t been able to figure out when or why it happens!

edit: added link to GIF
https://i.imgur.com/eQqopVI.gifv

Another thing I canā€™t get to work:
https://i.imgur.com/EU9Zmb4.png

When I add that to a pie menu, it shows up as grayed out, both in edit and object mode

As for the smoothness problem, I tried adding undo redo, and it doesnā€™t seem to have worked:

{
ā€œmenusā€: [
[
ā€œSubdivide / Unsubdivideā€,
ā€œMeshā€,
ā€œalt+Wā€,
[
[
ā€œSubdivideā€,
ā€œINVOKEā€,
ā€œā€,
ā€œbpy.ops.mesh.subdivide()ā€
],
[
ā€œDelta = 0ā€,
ā€œINVOKEā€,
ā€œā€,
ā€œdelta = 0ā€
],
[
ā€œUndo and Redoā€,
ā€œUPDATEā€,
ā€œā€,
ā€œbpy.ops.ed.undo_redo(TRUE)ā€
],
[
ā€œSubdivide / unsubdivideā€,
ā€œUPDATEā€,
ā€œā€,
ā€œbpy.ops.mesh.unsubdivide() if delta <0 else bpy.ops.mesh.subdivide(smoothness=0.0); delta = 0ā€
],
[
ā€œSmoothnessā€,
ā€œPROPā€,
ā€œWHEELUPMOUSE;;;0.10000000149011612;ā€,
ā€œC.active_operator.smoothnessā€
],
[
ā€œDeltaā€,
ā€œPROPā€,
ā€œMOUSEMOVE;-10.0;10.0;;ā€,
ā€œdeltaā€
],
[
ā€œMake Normals Consistentā€,
ā€œFINISHā€,
ā€œā€,
ā€œbpy.ops.mesh.normals_make_consistent(inside=False)ā€
],
[
ā€œOn Cancelā€,
ā€œCANCELā€,
ā€œā€,
ā€œbpy.ops.ed.undo()ā€
]
],
ā€œMODALā€,
ā€œmo?confirm=Trueā€,
ā€œPRESSā€,
ā€œā€,
ā€œā€
]
],
ā€œversionā€: ā€œ1.14.15ā€
}