Pie Menu Editor 1.18.7

Because blender internally seems to hide that part for some reason, the panel inside space_view3d.py had the correct path but no idea why is not shown directly

2 Likes

Hi,
Canā€™t remember if I ever asked this question but anyway here it is :wink:

Is it possible to display a created panel group if and only if a certain addon is installed and activated ?

Thanks for all your good work, without PME I could simply not use Blender

Iā€™m answering myself

In the panel group condition, type :
import addon_utils; return addon_utils.check("Addon")[0]
where you should replace Addon (but keep the ā€œā€) by your addonā€™s name (without .py) if this is a simple addon or the folder name if the addon is contained in a folder

Hope it could help

2 Likes

Also, some curious buggy behavior I found was that when I hold down the shortcut for the Pie Menu with that contains my light direction widget, then rotate the widget and while rotating, let go of the Pie Menu shortcut, the shadows just break. The widget stops working and there is no light in the scene, in Solid Mode. Then I will need to reset it through python by specifying a Vector value for light_direction, or I can set another Pie Menu command for a specific light direction which also fixes this weird issue. However, I can avoid the problem by not holding down the Pie Menu hotkey, but rather tapping it and letting go before I use the widget in the Pie Menu.

1 Like

I tried to replicate this and it only happens when the popup dialog is in Pie Mode, for some reason it sets the C.scene.display.light_direction to (0,0,0) and that breaks it.

I tried to make something to set a direction if it breaks

Custom tab:

d = C.scene.display.light_direction; C.scene.display.light_direction = (1,1,1) if (d[0],d[1],d[2]) == (0,0,0) else C.scene.display.light_direction; L.prop(C.scene.display, 'light_direction', text='')

It should run every time you call the menu and if the vector is 0,0,0 its going set it to 1,1,1

1 Like

Iā€™m trying to set up contextual pie menus, so i have one hotkey to rule them all.
All is working perfectly, Lights, Meshes, Empties.

Iā€™d love to have a context menu if i have nothing selected tho. Previously iā€™ve been using:

return not C.selected_objects
but it still opens up the objects pie menu which is:
return C.active_object and C.active_object.type == 'MESH'

Iā€™m guessing its because its using the active object?, which AFAIK you canā€™t deselect. anyone have some alternatives i can try?

I tried the same thing with bevel and knife tool. Works ok for knife but for bevel I los the ability to change the amount of division either by the UI or the mouse scroll wheel. Any idea?

In that case you could add more context to the mesh poll so it doesnā€™t conflict with the non selection menu.

return C.active_object and C.active_object.type == 'MESH' and C.active_object in C.selected_objects

Now the problem with this option is that you have to add and C.active_object in C.selected_objects to every single other type

1 Like

I think pme is executing both things too fast, so adding a ā€˜bumperā€™ translate operator seems to work for me at least. Itā€™s hacky but it does the jobā€¦

bpy.ops.object.mode_set(mode='EDIT'); bpy.ops.transform.translate('EXEC_DEFAULT', True); bpy.ops.mesh.bevel('INVOKE_DEFAULT', True)
2 Likes

Oh man! You made my day! No need to switch modes before!

1 Like

How can you make a button to active a tab in n panel with pie menu? I cant find the way to add them to pie menu addon?

This?

1 Like

That is an interesting approach. Gonna try that once i get some time.

@FidoDidoVN ; I ended up with using the ā€œHidden Panel Groupā€ for now and just add the panels of the add-ons I donā€™t use from the N panel to that groupe, then added a button in my custom pie menu to toggle that entire groupe on and of. If you read the responses I got from kkostovas I am sure you can make it work if you want to do it the same way. Just try to add the panels in the order they apear in the N panel so when you toggle them back on they stay in the ā€œoriginalā€ order. Hope that helps.

1 Like

Yeah comes in handy, that and the debug mode.

Iā€™ve been trying to add Tab Catagory to PME, but for some reason I canā€™t get it to work, I follow the LoopTools (Edit Mode) or BoolTool and others code, but PMEā€™s code doesnā€™t like a certain code section that I copied from the other addon, and my current Python skills cant understand (only dove into it last week, did manage to add to others though), I manage to get this far for PME,

image

but it doesnā€™t work, have to get into the preferences.py itself and change it manually,

Basically it lets you rename a addon N-Panelā€™s name, so one can organize themselves, which I think should be a requirement for Blender addons to get around the too many N-Panel tabs issues to a extent or just let us simply organize things.

image

rant over :smiley:

HELP - How to create a modal for Solidify in Mesh Edit Mode ?

Hi, not sure what is your goal exactely ? but if it is for better access with addons, this is how I deal with addons and pme. It can not suit to everyone but thatā€™s a trick:

2 Likes

Itā€™s just a simple N-Panel addon setting to let users change a addons Tab nameā€¦

1 Like

Iā€™m still a bit confused. Whatā€™s the purpose of ā€œCustomā€? Is it any different from ā€œCommandā€?

And how can I make a button that executes Python code that isnā€™t one-liner? Do I have to use an external script? Itā€™s just like 4 lines so Iā€™d rather to put it in PMEā€™s UI if possible.

Oops, How could you do that? @Juso3D great way, but I like it stay stable in n panel or tool panel, I donā€™t want to reopen after every click:)) Thank you all @Juso3D and @Elk!

I canā€™t explain for the custom tab but you can use macro operator for that

I create panels then disable or activate them with macro
Capture_11_26_20

2 Likes