Paint Mode: Erasing #98590

Open
opened 2022-06-04 16:36:53 +02:00 by Julien Kaspar · 3 comments
Member

NOTE: This task is currently to document the requirements for erasing workflows for painting. This should be the basis for discussions on the implementation.

Goal

For an intuitive painting workflow it's necessary to have an eraser accessible at all times.
This has been a shortcoming in Blender for painting, since the erasing of alpha channels has only been available as a blending mode for brushes.
This is very hard to access via the UI and shortcuts.

Recommendations

The ideal solution is to have a very simple brush tool in the toolbar. Aside from the typical texture, stroke, falloff and cursor settings, it can only erase alpha.

This tool can then have the shortcut E assigned by default to make it very accessible.

Pure Emissive Colors

The motivation behind not offering a blending mode to "Add Alpha" in the Erase Tool is because this has been notoriously difficult to do like the user would expect.
See #86868 & #83342.

When painting float or pre-multiplied images, the alpha is treated differently. Any color with an alpha 0 would have the RGB colors displayed as pure emissive colors and still visible.
The only way to erase the colors completely is to also erase the RGB channels to 0.

As a result the design for the brush should emphasise this: The Erase brush is a destructive tool!
If you erase the alpha directly via painting tools you should expect to likely lose the full RGBA color information.
The alpha 0 areas can be painted over with a new color afterwards.

For non destructive erasing of alpha values it is recommended to use a separate image as a mask. This can be done right now via nodes.
This non-destructive approach might not be very accessible right now but that can be addressed separately (Especially with the layered textures design)

Erasing Selections

We need to discuss how we want to handle other erasing operations like via Gesture Tools (Box/Lasso/Line Erase), or for example the Color Filter for gradual erasing. These generally affect the unmasked/selected areas.
There are different ways to enable this workflow.

Erase Operator

The simplest way would be to add an operator to the menus and mapped to a shortcut (Like Delete) to erase the colors on any selected areas.
The user would in that case use the existing Gesture Tools and brushes to mask/select areas to define the areas to be deleted.
This approach would follow the Select -> Operate paradigm of Blender closest.

Erase Tools

The existing Color Filter tool could receive an additional Filter Type to 'Erase'. This would allow gradual erasing in the case where it is needed.
Adding Gesture Tools specifically or erasing is also possible but might just bloat the Toolbar.

Erase Mode

An alternative approach is to make the "Erase Alpha" blending mode in the regular painting tools more accessible.
In other painting application such as Krita every tools and brush has an "Erase Mode" button that can be easily toggled with a shortcut and applies globally to all tools and brushes.
We could implement this design as an alternative to the Erase Tools/Brush for users that prefer this workflow.

In that case the Erase Alpha blending mode would be a button in the header that can be toggled directly, instead of being part of the blending modes popup.
A shortcut could also be assigned.
This toggle should be available for for all brushes and tools that affect colors.

NOTE: This task is currently to document the requirements for erasing workflows for painting. This should be the basis for discussions on the implementation. # Goal For an intuitive painting workflow it's necessary to have an eraser accessible at all times. This has been a shortcoming in Blender for painting, since the erasing of alpha channels has only been available as a blending mode for brushes. This is very hard to access via the UI and shortcuts. # Recommendations The ideal solution is to have a very simple brush tool in the toolbar. Aside from the typical texture, stroke, falloff and cursor settings, it can only erase alpha. This tool can then have the shortcut `E` assigned by default to make it very accessible. ## Pure Emissive Colors The motivation behind not offering a blending mode to "Add Alpha" in the Erase Tool is because this has been notoriously difficult to do like the user would expect. See #86868 & #83342. When painting float or pre-multiplied images, the alpha is treated differently. Any color with an alpha 0 would have the RGB colors displayed as pure emissive colors and still visible. The only way to erase the colors completely is to also erase the RGB channels to 0. As a result the design for the brush should emphasise this: **The Erase brush is a destructive tool!** If you erase the alpha directly via painting tools you should expect to likely lose the full RGBA color information. The alpha 0 areas can be painted over with a new color afterwards. For non destructive erasing of alpha values it is recommended to use a separate image as a mask. This can be done right now via nodes. This non-destructive approach might not be very accessible right now but that can be addressed separately (Especially with the [layered textures design](https://code.blender.org/2022/02/layered-textures-design/)) ## Erasing Selections We need to discuss how we want to handle other erasing operations like via Gesture Tools (Box/Lasso/Line Erase), or for example the Color Filter for gradual erasing. These generally affect the unmasked/selected areas. There are different ways to enable this workflow. **Erase Operator** The simplest way would be to add an operator to the menus and mapped to a shortcut (Like `Delete`) to erase the colors on any selected areas. The user would in that case use the existing Gesture Tools and brushes to mask/select areas to define the areas to be deleted. This approach would follow the Select -> Operate paradigm of Blender closest. **Erase Tools** The existing Color Filter tool could receive an additional Filter Type to 'Erase'. This would allow gradual erasing in the case where it is needed. Adding Gesture Tools specifically or erasing is also possible but might just bloat the Toolbar. ## Erase Mode An alternative approach is to make the "Erase Alpha" blending mode in the regular painting tools more accessible. In other painting application such as Krita every tools and brush has an "Erase Mode" button that can be easily toggled with a shortcut and applies globally to all tools and brushes. We could implement this design as an alternative to the Erase Tools/Brush for users that prefer this workflow. In that case the Erase Alpha blending mode would be a button in the header that can be toggled directly, instead of being part of the blending modes popup. A shortcut could also be assigned. This toggle should be available for for all brushes and tools that affect colors.
Author
Member
Added subscribers: @JulienKaspar, @JosephEagar, @Jeroen-Bakker, @jfmatheu
Author
Member

From the recent module meeting:

But we need to be aware of use cases to still add/remove alpha. For gamedev the alpha channel is often used for other purposes than transparency.

One possible fix: We can prevent destructive erasing by changing the behaviour directly in the color mixing of brushes & tools. This would prevent erasing the RGB values on color attributes and most image types (Including newly created images that aren’t saved yet).
When erasing on pre-multiplied images on the other hand, we could still allow erasing alpha channel in an expected way within Blender. Afterwards when saving the file it would cause data loss that should’ve happened already while erasing.
Here we must show a warning message to the user, which gives them the chance to save to another image format or ways to export before saving.

We'll discuss further how well we can preserve the Alpha channel while erasing.

From the [recent module meeting](https://devtalk.blender.org/t/2022-6-8-sculpt-texture-paint-module-meeting/24672): > But we need to be aware of use cases to still add/remove alpha. For gamedev the alpha channel is often used for other purposes than transparency. > > One possible fix: We can prevent destructive erasing by changing the behaviour directly in the color mixing of brushes & tools. This would prevent erasing the RGB values on color attributes and most image types (Including newly created images that aren’t saved yet). > When erasing on pre-multiplied images on the other hand, we could still allow erasing alpha channel in an expected way within Blender. Afterwards when saving the file it would cause data loss that should’ve happened already while erasing. > Here we must show a warning message to the user, which gives them the chance to save to another image format or ways to export before saving. We'll discuss further how well we can preserve the Alpha channel while erasing.
Member

Added subscriber: @EAW

Added subscriber: @EAW
Julien Kaspar changed title from Paint Mode: Eraser Tool to Paint Mode: Erasing 2022-09-01 10:01:14 +02:00
Julien Kaspar added this to the Sculpt, Paint & Texture project 2023-02-08 10:20:48 +01:00
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:11:18 +01:00
Iliya Katushenock removed the
Status
Needs Triage
label 2023-08-24 17:38:14 +02:00
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 Assignees
2 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#98590
No description provided.