Maniphest T101167

GPencil: Improve Sculpt Masking
Confirmed, NormalDESIGN

Assigned To
None
Authored By
Antonio Vazquez (antoniov)
Sep 18 2022, 3:55 PM
Tags
  • BF Blender
  • Grease Pencil
Subscribers
Antonio Vazquez (antoniov)
Daniel Martinez Lara (pepeland)
hamza.SMA (hamza.elbarmaki)
Joseph Eagar (joeedh)
Julien Kaspar (JulienKaspar)
Matias Mendiola (mendio)

Description

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: T101593

Automasking

  • Move Automasking to GPencil global area.
  • Add new Automasking by Stroke Layer.
  • Add new Automasking by Stroke Material.

Unified

  • Create new unified struct.

Event Timeline

Antonio Vazquez (antoniov) changed the task status from Needs Triage to Confirmed.Sep 18 2022, 3:55 PM
Antonio Vazquez (antoniov) created this task.
Antonio Vazquez (antoniov) added projects: BF Blender, Grease Pencil.
Antonio Vazquez (antoniov) changed the subtype of this task from "Report" to "Design".
Antonio Vazquez (antoniov) added subscribers: Julien Kaspar (JulienKaspar), Matias Mendiola (mendio), Daniel Martinez Lara (pepeland).
Antonio Vazquez (antoniov) added a comment.EditedSep 18 2022, 4:00 PM

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.

Antonio Vazquez (antoniov) updated the task description.Sep 18 2022, 4:02 PM
hamza.SMA (hamza.elbarmaki) added a subscriber: hamza.SMA (hamza.elbarmaki).Sep 18 2022, 4:07 PM
Julien Kaspar (JulienKaspar) added a comment.Sep 19 2022, 3:08 PM

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 Alt A.
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.

If we instead use A to toggle the current selection mode we get the same effect within sculpt mode, only faster in just one step.
This also opens up the shortcut Alt A for future global auto-masking.

We could even expand like with mesh sculpt mode by using a pie menu for the A shortcut.
This pie mneu could make any selection operator very acessible like:

  • Select All
  • Deselect All
  • Invert Selection
  • Toggle Selection Mode

Antonio Vazquez (antoniov) added a comment.Sep 29 2022, 3:42 PM

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"?

Julien Kaspar (JulienKaspar) added a subscriber: Joseph Eagar (joeedh).Sep 29 2022, 6:00 PM

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.
@Joseph Eagar (joeedh) also had interest in adressing Unified setting issues, so he might be willing to share his take on the issues or help out.

Julien Kaspar (JulienKaspar) added a comment.Sep 29 2022, 6:03 PM

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.

Antonio Vazquez (antoniov) added a comment.Sep 29 2022, 6:45 PM

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.

Antonio Vazquez (antoniov) added a comment.Sep 29 2022, 10:17 PM

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.

Antonio Vazquez (antoniov) updated the task description.Sep 29 2022, 10:27 PM
Antonio Vazquez (antoniov) updated the task description.
Julien Kaspar (JulienKaspar) mentioned this in T101593: Auto-Masking Popover for the Header.Oct 4 2022, 3:34 PM
Julien Kaspar (JulienKaspar) updated the task description.Oct 4 2022, 3:40 PM