Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush #50035

Closed
opened 2016-11-15 15:54:10 +01:00 by Maestro Pivetta · 8 comments

System Information
Windows8 QuadroFX5800

Blender Version
Blender 2.78

Short description of error
When using paint mode in UV/ImageEditor by selecting the fill brush and choosing Erase or Add Alpha, the "Fill threshold" bar disappears. Function works well, only the treshold has to be selected on another blending mode.

Exact steps for others to reproduce the error
Open UV/ImageEditor, set to Paint, select the Fill brush, change mode from mix to Erase Alpha.

**System Information** Windows8 QuadroFX5800 **Blender Version** Blender 2.78 **Short description of error** When using paint mode in UV/ImageEditor by selecting the fill brush and choosing Erase or Add Alpha, the "Fill threshold" bar disappears. Function works well, only the treshold has to be selected on another blending mode. **Exact steps for others to reproduce the error** Open UV/ImageEditor, set to Paint, select the Fill brush, change mode from mix to Erase Alpha.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @M.Pivetta

Added subscriber: @M.Pivetta
Member

Added subscriber: @LucaRood-3

Added subscriber: @LucaRood-3
Member

This fixes the issue:
P426: Fix for #50035

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index cca142b..fec6fdd 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -139,6 +139,9 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
                     panel.prop_unified_color(row, context, brush, "secondary_color", text="")
                     row.separator()
                     row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
+        else:
+            if brush.image_tool == 'FILL' and not projpaint:
+                col.prop(brush, "fill_threshold")
 
     elif brush.image_tool == 'SOFTEN':
         col = layout.column(align=True)

However, I think there is also an issue with the fill code itself, as it defines the fill area based on the threshold on the RGB channels, even when using the erase/add alpha blend mode. Shouldn't the fill area be defined using the values in the alpha channel itself?

This fixes the issue: [P426: Fix for #50035](https://archive.blender.org/developer/P426.txt) ```diff diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index cca142b..fec6fdd 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -139,6 +139,9 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal panel.prop_unified_color(row, context, brush, "secondary_color", text="") row.separator() row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="") + else: + if brush.image_tool == 'FILL' and not projpaint: + col.prop(brush, "fill_threshold") elif brush.image_tool == 'SOFTEN': col = layout.column(align=True) ``` However, I think there is also an issue with the fill code itself, as it defines the fill area based on the threshold on the RGB channels, even when using the erase/add alpha blend mode. Shouldn't the fill area be defined using the values in the alpha channel itself?

Added subscriber: @mont29

Added subscriber: @mont29

UI fix looks OK to me.

Regarding using alpha channel, am not sure… can think cases where each (based on colors or based on alpha) situation is valid actually.

Also, current way to compute whether color is included in threshold factor looks slightly broken to me? Shouldn’t we multiply threshold by square root of three before using it to compare the squared sum of the three differences? afaict, full black versus full white will give squared distance of three, which is totally unreachable with a threshold in [0, 1] range?

UI fix looks OK to me. Regarding using alpha channel, am not sure… can think cases where each (based on colors or based on alpha) situation is valid actually. Also, current way to compute whether color is included in threshold factor looks slightly broken to me? Shouldn’t we multiply threshold by square root of three before using it to compare the squared sum of the three differences? afaict, full black versus full white will give squared distance of three, which is totally unreachable with a threshold in [0, 1] range?

This issue was referenced by 27de0c40c5

This issue was referenced by 27de0c40c594b9a2e853ec2c3c913d5a16e68e84

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' 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
4 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#50035
No description provided.