Thank you, its working now!
Ah, shame I have to add a keymap (makes it harder to share my menus!), but thanks for the suggestion, Iāll try this out right away!
Think I found a workaround.
I was trying to get different types of mask with the same keymap using shift,alt,ctrl (add/substract/smooth) and it seems adding the draw operator at the end does the trick
so:
Create Sticky Key
On press, add the mask brush from the menu
Save and Restore Previous Value
You should get this
After adding the draw operator:
value = paint_settings(C).brush; paint_settings(C).brush = D.brushes["Mask"]; bpy.ops.sculpt.brush_stroke('INVOKE_DEFAULT')
Now you can call the mask brush with alt and left mouse
Extra Options
If you want to customize different brush settings you can add them before the operator by taking them from the info panel in scripting
For example I want to smooth the mask at .5 strength
I will have to add
bpy.data.brushes[āMaskā].mask_tool = āSMOOTHā
bpy.data.brushes[āMaskā].strength = 0.5
and would look like this
value = paint_settings(C).brush; paint_settings(C).brush = D.brushes["Mask"]; bpy.data.brushes["Mask"].mask_tool = 'SMOOTH'; bpy.data.brushes["Mask"].strength = 0.5; bpy.ops.sculpt.brush_stroke('INVOKE_DEFAULT')
The only ābutā from adding those it that it leaves the brush with those settings so every time I use the shortcut its going to change the brush to smooth and 0.5 strength
Iāll try this out and get back to you, but it sounds perfect. Thanks so much!
Edit: works like a charm!
Now to figure out if itās possible to tell if the cursorās over a mesh or over empty viewportā¦ Do you know of any way?
Iām guessing you would need a scrip that feeds information from the raycast but thatās out of my league, I just know the very basics.
In my case I just replaced the selection shortcuts with masking shortcuts in sculpt mode (lasso and box)
Iām having issues with GP contexts overriding eachother. @Motiomancer: pinging you, because you seem like you understand PME to a much higher degree than I do!
So, whatās the issue Iām trying to solve:
Iām creating my own Tab menus to switch modes. Iāve succesfully set this up for other modes, but with Grease Pencil Iām having a lot of trouble.
First off: adding my menu on āClickdragā overrides the default Tab behaviour
so: I added a Stack Key to toggle to Draw from Object mode,
and to Object Mode from all others.
Problem being, this works for everything except Draw Mode
Iāve tried a whole bunch of different configurations, and just canāt arrive t a working solution that doesnāt somehow ruin something else (like overwriting the menus I have for meshesā¦)
Edit: another example of what Iāve tried:
So, this works to go from all Edit Modes to Object with a press of TAB:
Except, when I now enable this to get TAB to go to Draw from Object Modeā¦
It doesnāt work!
Theyāre getting in eachothers ways I guess, but I donāt know what to do.
Hi there, does interactive panel work for anybody with blender 2.93? When i click āinteractive panelā in addon settings nothing happens. I also donāt find this in command with āmenu serachā
This is probably because of the Python changes in 2.93. Havenāt yet tried running PME in it myself, but lots of addons are affected!
Yeah, for once IĀ“m not jumping on the nightlies, sticking on stable release. ItĀ“ll be at least a month before we see large addon support for 2.93.
You could try giving a more specific context to the menus
instead of asking for a gpencil object
return C.active_object and C.active_object.type == 'GPENCIL'
gpencil object and in object mode
return C.active_object and C.active_object.type == 'GPENCIL' and C.active_object.mode == 'OBJECT'
gpencil object and not in object mode
return C.active_object and C.active_object.type == 'GPENCIL' and C.active_object.mode != 'OBJECT'
Other than that its about troubleshooting the menus, maybe disable all of them and start re enabling the tab ones to see which ones are in conflict
Hi. Trying to create shortcuts to new windows like shader editor:
bpy.ops.pme.popup_area(area=āShaderNodeTreeā, auto_close=False)
It works but try to save your scene with that window opened ( in my case on second display ). Youāll never see it again. Itāll crash Blender immediately after opening.
Hi,
Wondering if someone can help please.
I have added a list of my favorite modifiers to a pie menu (works great) however Iād like for the modifiers menu to open (or the ui to switch to the modifiers tab) when adding the modifier.
I know nothing about coding a simple explanation would be great.
I tried this: bpy.ops.object.modifier_add(type=āSUBSURFā),bpy.context.space_data.context = āMODIFIERā
I just added the second part after the bracket (got it from āinfoā tab) hoping it would workā¦It didnāt
Thanks
Ivan.
For powerful modifier management you can also check out Modifier List. I particularly love the on-screen pop-up menu with a complete modifier UI.
Again, exactly what I needed. I didnāt even know it was possible to use multiple statements here, or how to combine them. Thanks a lot!
ā¦
For me it didnāt work ā¦
but I have to say that I made a complex combination.
For each type of object has the same shortcut (Ctrl + D)
Object Mode and Edit Mode
On top of that there is the combination of (Stack Key + Pie Menu)
If I {press} (Ctrl + D) make the Subdivide command
If I {hold} (Ctrl + D) make the Subdivide command
Subdivide - Object Mode = Curve
.
Subdivide Pie Menu - Object Mode = Curve
.
Thanks Metin.
Is it possible to populate the ui side panel group with common commands? I canāt seem to add the vertex, edge, face commands from theemu to the ui side panel.
Also this panel canāt be added in anyway to a regular menu or side panel group?
Unfortunately no this panel is hard coded and we canāt have any access to it
Hello guys.Do you have any idea how to use the central point of the pie menu as an additional sot?
Take the standard āShadingā menu below for example.
If we could use its middle part as another slot, it could be a great place for the operator āview3d.toggle_shadingā (in this case), so we would have both: the entire pie menu and a quick switch between last two shading modes used, assigned to the same hotkey.
What do you think about it?
THx