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
Hi,
Canāt remember if I ever asked this question but anyway here it isIs 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
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.
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
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
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)
Oh man! You made my day! No need to switch modes before!
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?
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.
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,
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.
rant over
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:
Itās just a simple N-Panel addon setting to let users change a addons Tab nameā¦
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