Try to use a Macro Operator
with these 3 slots:
bpy.context.scene.b_painter_brush = 'Brush Blur'
bpy.ops.paint.image_paint(mode='NORMAL')
bpy.ops.pme.timeout(cmd="bpy.context.scene.b_painter_brush = 'Brush Default'")
Try to use a Macro Operator
with these 3 slots:
bpy.context.scene.b_painter_brush = 'Brush Blur'
bpy.ops.paint.image_paint(mode='NORMAL')
bpy.ops.pme.timeout(cmd="bpy.context.scene.b_painter_brush = 'Brush Default'")
Here is the code for Command
tab:
sel_bezier_splines = [s for s in C.object.data.splines if [p for p in s.bezier_points if p.select_control_point]]; is_bezier = len(sel_bezier_splines) > 0; bpy.ops.curve.spline_type_set('INVOKE_DEFAULT', True, type='POLY' if is_bezier else 'BEZIER')
Or Custom
tab with customizable icons and labels:
sel_bezier_splines = [s for s in C.object.data.splines if [p for p in s.bezier_points if p.select_control_point]]; is_bezier = len(sel_bezier_splines) > 0; L.operator("pme.exec", text="Bezier" if is_bezier else "Poly", icon='IPO_BEZIER' if is_bezier else 'IPO_CONSTANT').cmd = "bpy.ops.curve.spline_type_set('INVOKE_DEFAULT', True, type='%s')" % ('POLY' if is_bezier else 'BEZIER')
Not in PME. The add-on uses existing Blender keymaps.
Hi
Letâs imagine that I want to change size / opacity / hardness of a painting brush only by pressing RMB (for size, RMB + Shift for opacity etc. ) and swiping to the left or right, by releasing RMB confirming the action ( especially useful and fast while using graphic tablet ).
Iâve done it by modal operator but it lacks of visualization circle of mouse movement and seams updating the parameters too rare ( in Mudbox itâs updating every pixel of movement ). Is there a way to use movement of a mouse also in top/ bottom direction?
So tried to achieve it in another way by regular Blender Keymap menu:
Everything looks OK but program is not remembering my modification of a parameter - he just goes back to original size of a brush after releasing RMB.
Any ideas how to resolve the problem by any of these paths?
ps. @roaoao : thanks for your previous advice - works like a charm
Hi @roaoao, Is it possible to reuse (change the parameter values) a modifier without stacking another within in the modal operator? Iâm confused on how the order of the items within the operator has to be.
Hi. roaoao.
I specified the following code in the command field of Stack Key and tried to call the toolbar menu, but it doesnât call the menu for some reason.
bpy.ops.wm.toolbar()
By the way, I was able to call the menu normally as a result of calling directly from the shortcut menu without using Pie Menu Editor.
Works for me.
Make sure that you use it in supported area (3DView etc.) and check the hotkey and keymap.
You can customize the threshold and direction in PME Preferences > Settings > Modal Operator
Will add an option to use both vertical and horizontal directions in the next version.
Note that Modal Operators have Confirm on Release option. It will be useful here.
RMB is used to cancel Radial Control tool. Thatâs why it goes back to original size.
thank you, it worked really well. If you dont mind, may i know why doesnt it work if i simply copy the modifier operator into the âon invokeâ section?
Hi Roaoao. Thanks for all of your help. I ill have to figure something else or with the curve tools, but the making tool worked for me. Iâm trying to create a (toggle) Stack Key with a Macro Operator in Grease Pencil that selects a specific layer and material by Name. If I use the Stack Key again, it reverts back to the last material and layer.
Thanks again.
This code brings a âInvalid Syntaxâ message when I paste it into the âCommandâ field. What should be changed with current versions of the addon to make it work?
Or maybe there are already other methods of splitting areas implemented?
Add 'INVOKE_DEFAULT', True
for operators:
bpy.ops.object.shade_flat('INVOKE_DEFAULT', True) if bpy.context.object.data.polygons[0].use_smooth else bpy.ops.object.shade_smooth('INVOKE_DEFAULT', True)
On Invoke
runs modifier operator (adds a new modifier to the stack) each time you call the modal.
Please export and pm me these Stack Key and Macro.
Thanks. Here is the fixed code:
a = C.area; x = a.x + (a.width >> 1); y = a.y + a.height; C.window.cursor_warp(x, y); bpy.ops.pme.timeout(delay=0.0001, cmd="bpy.ops.screen.area_move(x=%d, y=%d, delta=-100)" % (x, y))
Please export and pm me these Stack Key and Macro.
Shadow-Material-Layer.json (533 Bytes)
Basically, when Iâm drawing characters, I want to switch from line, to fill, to adding shadows to those characters without going to the materials tab and the layers tab each time.
I have a line layer that I use with a line material, a fill layer with fill material, and another fill layer with the multiply blend mode with fill material for shadows.
I want to have a toggle in a pie menu that automatically switches layers and materials with a single button and reverts back if I hit the button again.
So If I want to add shadows to my characters on the fly, I can instantly without the hassle of manually changing layers and materials, with the press of one button.
I donât really have this figured out as a whole but one thing I noticed was that I canât seem to get PME to recognize layers and materials by name, only number index.
Hi.
How to set coordinates of called PIE menu in the center of the screen?