EVENT_ icons can't be drawn in inactive (muted) or alert (red) states #120383

Open
opened 2024-04-07 21:10:52 +02:00 by MACHIN3 · 1 comment

System Information
Operating system: Linux-6.6.10-76060610-generic-x86_64-with-glibc2.35 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3080 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 550.54.14

Blender Version
Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: 40a5e739e270
Worked: -

Short description of error
Using EVENT_... icons with bpy.types.UILayout.label(), it's impossible to affect them using layout.active, layout.enabled or layout.alert to draw them more muted or in red.
This seems to work for all other icons (that I have tested) however.

See:
image

And note how the image icon is always white, and not grey muted or red like the other icons or the following text.

I've gone back to Blender 3.1 and it didn't work there either, so probably has been a thing since forever.

You can test using this little script to draw in the scene panel:

import bpy

def draw_labels(layout):
    layout.label(text="Info", icon='INFO')
    layout.label(text="Word", icon='WORLD')
    layout.label(text="Left Mouse" , icon='MOUSE_LMB')
    layout.label(text="Event E" , icon='EVENT_E')

def scene_panel(self, context):
    layout = self.layout
    
    # draw active (normal)
    column = layout.column()
    column.active = True
    draw_labels(column)
    
    layout.separator()
    
    # draw inactive (muted)
    column = layout.column()
    column.active = False
    draw_labels(column)
    
    layout.separator()

    # draw alert (red)
    column = layout.column()
    column.alert = True
    draw_labels(column)
    
    layout.separator()

bpy.types.SCENE_PT_scene.prepend(scene_panel)

Or by loading the attached .blend file, and running the script in the text editor.

Exact steps for others to reproduce the error

  • run the script above or the one in the attached .blend file
  • observe how the other icons are drawn and compare to the EVENT_E icon
**System Information** Operating system: Linux-6.6.10-76060610-generic-x86_64-with-glibc2.35 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3080 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 550.54.14 **Blender Version** Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: `40a5e739e270` Worked: - **Short description of error** Using `EVENT_...` icons with `bpy.types.UILayout.label()`, it's impossible to affect them using `layout.active`, `layout.enabled` or `layout.alert` to draw them more muted or in red. This seems to work for all other icons (that I have tested) however. See: ![image](/attachments/7ca0b485-30ba-4db8-9c6b-ed514c919842) And note how the ![image](/attachments/e9632c19-9bb8-4264-a757-f62d1adbe23b) icon is always white, and not grey muted or red like the other icons or the following text. I've gone back to Blender 3.1 and it didn't work there either, so probably has been a thing since forever. You can test using this little script to draw in the scene panel: ``` python import bpy def draw_labels(layout): layout.label(text="Info", icon='INFO') layout.label(text="Word", icon='WORLD') layout.label(text="Left Mouse" , icon='MOUSE_LMB') layout.label(text="Event E" , icon='EVENT_E') def scene_panel(self, context): layout = self.layout # draw active (normal) column = layout.column() column.active = True draw_labels(column) layout.separator() # draw inactive (muted) column = layout.column() column.active = False draw_labels(column) layout.separator() # draw alert (red) column = layout.column() column.alert = True draw_labels(column) layout.separator() bpy.types.SCENE_PT_scene.prepend(scene_panel) ``` Or by loading the attached .blend file, and running the script in the text editor. **Exact steps for others to reproduce the error** * run the script above or the one in the attached .blend file * observe how the other icons are drawn and compare to the `EVENT_E` icon
MACHIN3 added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-04-07 21:10:53 +02:00
Member

Can confirm. Looks like those are "Colored icons" defined with DEF_ICON_COLOR instead of DEF_ICON_VECTOR, I guess that's why it will preserve color.

To me it would be best if it can be drawn semi-transparent or tinted red in this kind of situations.

Suggestion would be improve the GPU_SHADER_ICON into something that also accepts desaturation/tint arguments.

@ideasman42 Is this your area?

Can confirm. Looks like those are "Colored icons" defined with `DEF_ICON_COLOR` instead of `DEF_ICON_VECTOR`, I guess that's why it will preserve color. To me it would be best if it can be drawn semi-transparent or tinted red in this kind of situations. Suggestion would be improve the `GPU_SHADER_ICON` into something that also accepts desaturation/tint arguments. @ideasman42 Is this your area?
YimingWu added
Module
User Interface
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-04-08 05:46:08 +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 project
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#120383
No description provided.