Sculpt Mode Cavity Masking #98383

Closed
opened 2022-05-25 19:49:23 +02:00 by Julien Kaspar · 11 comments
Member

Goal

To make the Paint Mode implementation feature complete we need to include an a way to mask the surface based on Cavity.

A first implementation of this has already been started in the sculpt-dev branch and can be further worked on.
In that case this feature will become a new automasking option in sculpt mode and and paint mode as well.

Proposal

The way we want to handle this is via the auto-masking options in sculpt mode. Since paint mode is based on the same code, the feature can be used for both modes.

Advantages:

  • Can be toggled on the fly
  • The auto-mask can be combined with other auto-masking methods without changing the painted mask.
  • Masked areas can be changed non-destructively
  • The auto-mask will update to the latest surface curvature

Settings

There are various controls that are needed to get the cavity mask users want.

  • Falloff curve (Full control over which areas of the mesh curvature will be auto-masked)
  • Inverted Cavity (An easy toggle to flip the effect of the auto-mask)
  • Smoothing Steps
    • Currently called propagation steps. We could rename the setting to smoothing and keep calling it propagation in the tooltip and code
    • This setting must be exclusively tied to the cavity auto-masking, instead of using the regular propagation steps in the brush settings.

There are other design aspects to consider.

Performance

On high polycounts or when using a high amount of propagation steps it is likely to cause lag on each brush stroke.
@JosephEagar pointed out that D14272 and an API for temporary attributes would fix this.

Another boost could be to check if any important changes happened to the mesh in between strokes.
If vert positions haven't changed then the cavity auto-masking doesn't need to be recalculated on repeated strokes. So it would often only lag once.

The same could then be done for topology and face set auto-masking if the cursor is still targeting the same area.
Boundary auto-masking would also benefit from this.
This needs to be discussed and tested further.

Visualising the Cavity Mask

There needs to be some visual feedback on what is currently being auto-masked. Especially when we add fine control over propagation steps and what curvatures are masked via a falloff curve.

Since the automask is only generated under the brush cursor when doing a stroke, this becomes hard to implement.
If no solution is found, then a better way would be use an operator to convert the cavity automask into a regular mask attribute direectly.

Persistent Cavity Mask

There needs to be an option to keep the cavity mask persistent between strokes.

This would be easiest to implement with an operator to create a mask attribute based on the current cavity masking settings.
An operator like this could have multiple purposes:

  • Use a persistent mask for detailed sculpting adjustments
  • Visualise and edit more complex cavity masks
  • Bake or export cavity masks for further workflows

We already have an operator like this called "Dirt Mask". This operator could be updated to use the same settings as the cavity automask.
For clarity it could then be renamed to "Mask by Cavity", with a tooltip that states that the Cavity automask settings are used for this operator.
Additional adjust last operation options should be made available too.

# Goal To make the Paint Mode implementation feature complete we need to include an a way to mask the surface based on Cavity. A first implementation of this has already been started in the sculpt-dev branch and can be further worked on. In that case this feature will become a new automasking option in sculpt mode and and paint mode as well. # Proposal The way we want to handle this is via the auto-masking options in sculpt mode. Since paint mode is based on the same code, the feature can be used for both modes. **Advantages:** - Can be toggled on the fly - The auto-mask can be combined with other auto-masking methods without changing the painted mask. - Masked areas can be changed non-destructively - The auto-mask will update to the latest surface curvature ## Settings There are various controls that are needed to get the cavity mask users want. - Falloff curve (Full control over which areas of the mesh curvature will be auto-masked) - Inverted Cavity (An easy toggle to flip the effect of the auto-mask) - Smoothing Steps - Currently called propagation steps. We could rename the setting to smoothing and keep calling it propagation in the tooltip and code - This setting must be exclusively tied to the cavity auto-masking, instead of using the regular propagation steps in the brush settings. --- There are other design aspects to consider. ## Performance On high polycounts or when using a high amount of propagation steps it is likely to cause lag on each brush stroke. @JosephEagar pointed out that [D14272](https://archive.blender.org/developer/D14272) and an API for temporary attributes would fix this. Another boost could be to check if any important changes happened to the mesh in between strokes. If vert positions haven't changed then the cavity auto-masking doesn't need to be recalculated on repeated strokes. So it would often only lag once. The same could then be done for topology and face set auto-masking if the cursor is still targeting the same area. Boundary auto-masking would also benefit from this. This needs to be discussed and tested further. ## Visualising the Cavity Mask There needs to be some visual feedback on what is currently being auto-masked. Especially when we add fine control over propagation steps and what curvatures are masked via a falloff curve. Since the automask is only generated under the brush cursor when doing a stroke, this becomes hard to implement. If no solution is found, then a better way would be use an operator to convert the cavity automask into a regular mask attribute direectly. ## Persistent Cavity Mask There needs to be an option to keep the cavity mask persistent between strokes. This would be easiest to implement with an operator to create a mask attribute based on the current cavity masking settings. An operator like this could have multiple purposes: - Use a persistent mask for detailed sculpting adjustments - Visualise and edit more complex cavity masks - Bake or export cavity masks for further workflows We already have an operator like this called "Dirt Mask". This operator could be updated to use the same settings as the cavity automask. For clarity it could then be renamed to "Mask by Cavity", with a tooltip that states that the Cavity automask settings are used for this operator. Additional adjust last operation options should be made available too.
Joseph Eagar was assigned by Julien Kaspar 2022-05-25 19:49:23 +02:00
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @JulienKaspar

Added subscriber: @JulienKaspar

Added subscriber: @TheRedWaxPolice

Added subscriber: @TheRedWaxPolice

Added subscriber: @tiagoffcruz

Added subscriber: @tiagoffcruz
Member

For persistent mode, we could have a "bake to mask" option, and maybe enable multiple mask attribute layers in the code (shouldn't be hard).
That way we can support multires seamlessly (which has hardcoded support for masks).

For persistent mode, we could have a "bake to mask" option, and maybe enable multiple mask attribute layers in the code (shouldn't be hard). That way we can support multires seamlessly (which has hardcoded support for masks).

Added subscriber: @uelix

Added subscriber: @uelix

Hi, idk if it is considered but a pointiness mask option, maybe inside this mask or as its own thing, could be really useful too, it is quite common to use that as base when you are texturing hard surface objects.

Hi, idk if it is considered but a pointiness mask option, maybe inside this mask or as its own thing, could be really useful too, it is quite common to use that as base when you are texturing hard surface objects.

Added subscriber: @Sparazza

Added subscriber: @Sparazza
Author
Member

Notes from previous module meeting:

We then further discussed how to expose inverted cavity for this patch.
One approach is to expose it as 3 options that are mutually exclusive to the user:

  • Disabled
  • Enabled
  • Enabled Inverted
    This would be the most convenient and should be the way to interact with cavity auto masking via the pie menu.
    The proposal is to still show the “Invert Cavity” toggle as a sub-setting of the cavity auto-masking toggle in the options panel.
    But in the pie menu they would be exposed as equal options “Cavity” and “Inverted Cavity”.
    Choosing Cavity will enable the cavity auto masking and disable inverted cavity.
    Choosing Inverted Cavity will enable cavity auto masking and enable inverted cavity.
    Only one of the two can be enabled (highlighted) at once in the pie menu.
    Choosing any of them them again will disable both.
    This would be an unusual solution but potentially the best for the user.

We also discussed the operator to create a cavity mask. As of right now this is implemented as a new tab to bake the current auto masks. That is not ideal. We need to make these distinct operators.
For cavity masks we can make a replacement for the “Dirty Mask” operator in the mask menu simply called “Cavity Mask”. The same could then be done for a “Normal Mask” operator.
These operators would then use the auto mask settings by default when used, but the result can be tweaked further with adjust last operation settings.

Notes from previous module meeting: > We then further discussed how to expose inverted cavity for this patch. > One approach is to expose it as 3 options that are mutually exclusive to the user: > > - Disabled > - Enabled > - Enabled Inverted > This would be the most convenient and should be the way to interact with cavity auto masking via the pie menu. > The proposal is to still show the “Invert Cavity” toggle as a sub-setting of the cavity auto-masking toggle in the options panel. > But in the pie menu they would be exposed as equal options “Cavity” and “Inverted Cavity”. > Choosing Cavity will enable the cavity auto masking and disable inverted cavity. > Choosing Inverted Cavity will enable cavity auto masking and enable inverted cavity. > Only one of the two can be enabled (highlighted) at once in the pie menu. > Choosing any of them them again will disable both. > This would be an unusual solution but potentially the best for the user. > > We also discussed the operator to create a cavity mask. As of right now this is implemented as a new tab to bake the current auto masks. That is not ideal. We need to make these distinct operators. > For cavity masks we can make a replacement for the “Dirty Mask” operator in the mask menu simply called “Cavity Mask”. The same could then be done for a “Normal Mask” operator. > These operators would then use the auto mask settings by default when used, but the result can be tweaked further with adjust last operation settings.

This issue was referenced by 0156a677c7

This issue was referenced by 0156a677c7d13106a1d049d74fca43b5311eb53e
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#98383
No description provided.