GPencil: Improve Sculpt Masking
Julien Kaspar wrote (copied from chat):
I checked out D14589 GPencil: New Automasking Strokes for Sculpt recently.
I think this feature could use some needed improvements to make it more consistent and just as useful as the mesh sculpt mode auto-masking options:
First off, "Stroke" auto-masking requires too much precisions. You need to click direclty on the stroke to make the brush have an effect. It would be better if the nearest stroke to the cursor position would be detected, similar to selecting.
"Layer" and "Material" auto-masking does not at all behave like auto-masking. Currently when these options are enabled it will look at which layer/material is active and will only affect those.
But auto-masking should not work based on any active layer or material, but instead based on what is under the cursor when the stroke is started. It is a feature to dynamically auto-mask areas of the object on each stroke, not a static mask that you set beforehand.
Also, the use case of the current auto-masking behaviour was already covered with auto-locking layers and selecting all strokes of a material.
I suggest to change the behaviour to make it more consistent with mesh sculpt mode auto-masking.
Lastly, the auto-masking toggles are right right now only presented as brush options. While mesh sculpt mode also has them as brush options, it is not the primary intended way to use this feature! The brush auto-masking is purely to define a custom brush preset. It's a corner case feature.
The proper way to access and toggle auto-masking options is via the Alt A pie menu, to toggle them for the entire sculpt mode.
This way any brush or tool is able to use auto-masking and it's very convenient to toggle on/off.
The way it currently behaves in grease pencil forces the user to toggle the auto-masking options for each brush individually, which ends up being tedious and leads to many auto-masking toggles left enabled accidental when switching brushes.
I don't have a good suggestion for a pie menu shortcut at the moment since Alt A is already taken. I also noticed that there are no mode "Options" in grease pencil, like in mesh sculpt mode.
I would like to create a task to add the mode auto-masking options to the center of the header, in both grease pencil and mesh sculpt mode to make them more accessible in both modes and present them as the primary way to use auto-masking.
More information about the layout design here: #101593
- Move Automasking to GPencil global area.
- Add new Automasking by Stroke Layer.
- Add new Automasking by Stroke Material.
- Create new unified struct.
Changed status from 'Needs Triage' to: 'Confirmed'
Stroke" auto-masking requires too much precisions. You need to click direclty on the stroke to make the brush have an effect. It would be better if the nearest stroke to the cursor position would be detected, similar to selecting.
I can try to improve that.
About Automasking Layers and Materials, IMHO we would need both options: Active Layer/Material and Stroke Layer/Material... I mean, sometimes is good to masking the active layer, but your idea is add a new type to use the layer of the stroke below the cursor...the same for materials, so we will add 2 new modes.
the way it currently behaves in grease pencil forces the user to toggle the auto-masking options for each brush individually
This a known limitation in Gpencil...we haven't a shared settings (global) as you have in mesh sculpt where you have a brush settings, but also a global settings. The same problem you talked about is for size too. We could try to move to a shared place the automasking as you propose.
Adding two more auto-maskign options sounds fine. I just wonder if it makes more sense to use the already existing "Auto-Lock" feature for layers.
The same feature could be introduced for materials as well.
Once there are global auto-masking options I think grease pencil also needs a pie menu to access them. In mesh sculpt mode we use
I have an idea how we can make the
Alt + A shortcut availbile for grease pencil sculpt mode:
Here are some flow maps showing the issue of the De-/ Select All oeprators in sculpt mode.
This is a visualisation of the current use of the shortcuts. Note that Selecting All and toggling the selection mode off has the same effect.
Meanwhile Deselecting All will lead to the undesireable effect of not being able to do anything.
We could even expand like with mesh sculpt mode by using a pie menu for the
This pie mneu could make any selection operator very acessible like:
- Select All
- Deselect All
- Invert Selection
- Toggle Selection Mode
I have been looking at the code and it's possible to reuse the unified size and strength already in place for Mesh Sculpt brushes. If we reuse this, we could use the same size for all Draw and Sculpt grease pencil brushes. My only concern is that this also will affect on the Mesh Sculpt brush size... I mean, if you change the size of the brush in GPerncil Sculpt, when you use a Mesh Sculpt brush, you will get the same size. Same for strength.
About the masking options, if we start using unified settings, we could move the actual masking options to the unified structure. Will we have to keep the masking at the Brush level, or can we consider these options "global"?
Here's my view on the "Unfiied" setting for brushes: We should make this setting eventually as mode specific as possible.
Meaning that each mode in each object type has its own unified value for settings.
This will for example ensure a unified size or strenght among different brushes within Draw mode, but in a different unfiied size & strenght for Weight painting.
Each mode has a very different requirement for these settings, so it makes sense to keep them independent.
This goes against the current design so we should discuss this in more detail.
@JosephEagar also had interest in adressing Unified setting issues, so he might be willing to share his take on the issues or help out.
For auto-masking specifically I'd still prefer we also include global toggles that are not part of the brush settings.
IMO that would be more useful and consistent.
If we decide to split the unified settings for Grease Pencil, then automasking is not a problem. If we decide to reuse existing struct, then we can add the automasking in this struct too, but will not be visible in any non GPencil brush or we can put in a different place and don't use the unified struct for automasking.
In both cases, automasking would be a global toggle option.
To not blocking this task, we can start moving automasking to a shared place and make it global. Actually, we have already a global setting for all sculpt gpencil brushes, so we can move the automasking there. After moving in a patch, the next patch is add new automasking modes.
Later, we can follow with the unified size and strength, but this need more discussions because it can affect other areas of Blender.
Deleting a branch is permanent. It CANNOT be undone. Continue?