Page MenuHome

Sculpt Mask brush toggle hotkey is broken
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Win 10

Blender Version
Broken: blender-2.83-7c0e28594840-windows64
Worked: blender-2.80-windows64

Short description of error
The sculpting mask brush hotkey (M) used to work as a toggle on previous versions of blender, which means, if you press "M" it would switch to the mask brush, and once you press "M" again it would switch back to the previous sculpting brush you were using. But that's no longer the case, even though the Toggle property checkbox is enabled in the keymap...

Exact steps for others to reproduce the error
Launch Blender
Go to File/New/Sculpting
Press "M" and it will switch to the mask brush
Press "M" again and nothing will happen. (it should toggle back to the draw brush)

Event Timeline

The shortcut of draw brush is X though

The shortcut of draw brush is X though

Of course. But what it has to do with this bug report?
Have you tried to replicate the bug?

I can confirm this regression.

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Apr 7 2020, 3:58 PM
Richard Antalik (ISS) updated the task description. (Show Details)

Think I got it, Diff incoming shortly...

This is because we correctly switch the brush back to Brush->toggle_brush, but immediately after set the tool to the Tool for which the hotkey is assigned.
https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/sculpt_paint/paint_ops.c$737

First I thought it would be easy to get the tool from the toggle_brush, but needs a bit more investigation...