Is the invert command for weight painting functional?

I am trying to get the classic alt-click inverted stroke mode for painting weights but it doesn’t work. Does anyone know if this is a known bug or have I set something incorrectly?

I 'am unsure what you mean, however, in weight painting mode Alt + Click & Drag is for like drawing a line…

& working fine in 2.8 & 2.7…

Can you more clarify the prob?

I’m referring to the standard alt invert stroke mode that is ubiquitous in most creation software, including Blender (in sculpting for example).

Should toggle SUB mode here:

Ideally, you would be able to set any brush mode to any keystroke but I cannot seem to set any. I was hoping someone would know a little python so I could toggle this mode on keystroke but perhaps it isn’t possible?

I have set some pie menus to switch from one to the other but it is still slower than inversion on click.

Yes. Stroke mode Invert does not work for weight paint mode.

A brush in Weight paint mode is not refering to a direction or a color but to a weight.
And that is not necessary pertinent to choose to invert a weight of 0.75 for a weight of 0.25.
So, approach chosen for this mode is to have a shortcut key to quickly sample a weight by hovering mesh.
That explains why default brush is a Mix brush.
User paint an area with weight at 1, non paint area correspond to a weight of 0.
Sampling Zero area allows to bring corrections with same brush to One area if it is too large.
Paint Palettes addon also help to quickly change a weight.

You can not call a specific brush. That is a lack that has been reported and will be treated.
But if you want to switch between blend modes, you can.
For that, you have to create a shortcut with an Identifier named : wm.context_toggle_enum
Then, as Context Attributes, you have to indicate : tool_settings.weight_paint.brush.blend
Then, you can make a toggle between ADD and SUB values.

1 Like

That works a charm, my thanks to you.

I come from Zbrush so the alt:invert workflow is so deeply grooved into my neurons that anything else feels a bit slow. The toggle is certainly better than what I had.

I notice there is a statement wm. rather than bpy. that I see on that command. Does that denote commands that can be accessed through keys?

wm is an abbreviation for window manager.
wm.context corresponds to context of window.
It is a way to change properties or buttons exposed in the window according to context.

Defining shortcuts for keymap by using python API is not same thing as scripting.
In a python script, each line is not necessary calling API.
Instead of precising bpy for everything, it was simply skipped into shortcuts definition.

1 Like