Anim: Improve readability of channel colors in channel list #112861

Manually merged
Sybren A. Stüvel merged 8 commits from dr.sybren/blender:pr/69059-anim-channel-bg-color into main 2023-09-29 08:44:13 +02:00

Draw anim channel colors as a little rectangle in the channel list, instead of taking over the entire channel background. This keeps the channel names readable, regardless of the channel colors.

Channel colors are typically set via the bone colors, and since those are chosen for visual contrast in the 3D Viewport, they aren't guaranteed to also be a suitable background color for the channel list. Because of this, it's no longer used as such.

This includes changes to both regular FCurve channels & groups, as well as Grease Pencil layers.

Design task: #69059

Before After
Before After

The changes can be described as:

  • The channels are always drawn as if the "Channel GroupColors" preference is disabled.
  • The color rectangle is shown when the "Channel Group Colors" preference is enabled.
  • Versioning code turns the "Channel Group Colors" preference on regardless of what it was before, as the setting is now considerably less intrusive / disruptive.
  • RNA code is altered to set the default value for that preference to 'true'.

I have doubts about the last step. A similar flag (AUTOKEY_FLAG_XYZ2RGB) doesn't need explicit setting of the default to true in RNA, yet a factory startup will start with it enabled, and also "Reset to Default Value" in the GUI will reset it to 'enabled' as well.

Draw anim channel colors as a little rectangle in the channel list, instead of taking over the entire channel background. This keeps the channel names readable, regardless of the channel colors. Channel colors are typically set via the bone colors, and since those are chosen for visual contrast in the 3D Viewport, they aren't guaranteed to also be a suitable background color for the channel list. Because of this, it's no longer used as such. This includes changes to both regular FCurve channels & groups, as well as Grease Pencil layers. Design task: #69059 | Before | After | | -- | -- | | ![Before](/attachments/4ce7420a-15b0-4bd5-83ca-0acceca14e1d) | ![After](/attachments/0542e851-1b2a-4abc-a5d3-6ad611ed7b90) | The changes can be described as: - The channels are always drawn as if the "Channel GroupColors" preference is disabled. - The color rectangle is shown when the "Channel Group Colors" preference is enabled. - Versioning code turns the "Channel Group Colors" preference on regardless of what it was before, as the setting is now considerably less intrusive / disruptive. - RNA code is altered to set the default value for that preference to 'true'. I have doubts about the last step. A similar flag (`AUTOKEY_FLAG_XYZ2RGB`) doesn't need explicit setting of the default to `true` in RNA, yet a factory startup will start with it enabled, and also "Reset to Default Value" in the GUI will reset it to 'enabled' as well.
Sybren A. Stüvel added 2 commits 2023-09-25 17:34:40 +02:00
9e6c94dcb6 Anim: Improve readability of channel colors in channel list
Draw anim channel colors as a little rectangle in the channel list,
instead of taking over the entire channel background. This keeps the
channel names readable, regardless of the channel colors.

Channel colors are typically set via the bone colors, and since those
are chosen for visual contrast in the 3D Viewport, they aren't
guaranteed to also be a suitable background color for the channel list.
Because of this, it's no longer used as such.

Design task: #69059
Sybren A. Stüvel added 1 commit 2023-09-25 17:50:41 +02:00
Sybren A. Stüvel added the
Module
Animation & Rigging
label 2023-09-25 17:50:46 +02:00
Sybren A. Stüvel added this to the 4.0 milestone 2023-09-25 17:50:49 +02:00
Sybren A. Stüvel requested review from Julian Eisel 2023-09-25 17:51:05 +02:00
Sybren A. Stüvel requested review from Falk David 2023-09-25 17:51:05 +02:00
Sybren A. Stüvel requested review from Nathan Vegdahl 2023-09-25 17:51:13 +02:00
Sybren A. Stüvel added the
Interest
Grease Pencil
label 2023-09-25 17:51:19 +02:00
Sybren A. Stüvel requested review from Christoph Lendenfeld 2023-09-25 17:55:55 +02:00
Christoph Lendenfeld requested changes 2023-09-26 10:23:20 +02:00
Christoph Lendenfeld left a comment
Member

no complaints from the code side

the text cutoff logic needs to be adjusted though
image

Also as you can see in my image the padding to the right end of the channel box is different for me. Not sure where that is coming from though.

From a user side it would be good to know if it's ok to lose the colored backgrounds in the keyframes region. I feel like it's more useful there, because it means you don't need to trace the channels from the channel box to know where the keys belong to. As in it provides easy visual grouping without needing to look somewhere else

no complaints from the code side the text cutoff logic needs to be adjusted though ![image](/attachments/8bd2dbaf-2514-47ab-bc81-d1abd4f6ce4c) Also as you can see in my image the padding to the right end of the channel box is different for me. Not sure where that is coming from though. From a user side it would be good to know if it's ok to lose the colored backgrounds in the keyframes region. I feel like it's more useful there, because it means you don't need to trace the channels from the channel box to know where the keys belong to. As in it provides easy visual grouping without needing to look somewhere else
Sybren A. Stüvel added 1 commit 2023-09-26 11:23:06 +02:00
Author
Member

the text cutoff logic needs to be adjusted though

It's coming from a very strong coupling between ANIM_channel_draw_widgets() and ANIM_channel_draw(). Basically the latter has to know exactly what the former is doing. There is a lot to improve in this code.

Also as you can see in my image the padding to the right end of the channel box is different for me. Not sure where that is coming from though.

No idea either. I've played around with the preferences, but can't get that to appear here.

From a user side it would be good to know if it's ok to lose the colored backgrounds in the keyframes region. I feel like it's more useful there, because it means you don't need to trace the channels from the channel box to know where the keys belong to. As in it provides easy visual grouping without needing to look somewhere else

This would be good to discuss in the module meeting. In the mean time, I think it's better to land this sooner than later (before bcon3) and treating the adjustment of that particular aspect as polish.

> the text cutoff logic needs to be adjusted though It's coming from a very strong coupling between `ANIM_channel_draw_widgets()` and `ANIM_channel_draw()`. Basically the latter has to know exactly what the former is doing. There is a lot to improve in this code. > Also as you can see in my image the padding to the right end of the channel box is different for me. Not sure where that is coming from though. No idea either. I've played around with the preferences, but can't get that to appear here. > From a user side it would be good to know if it's ok to lose the colored backgrounds in the keyframes region. I feel like it's more useful there, because it means you don't need to trace the channels from the channel box to know where the keys belong to. As in it provides easy visual grouping without needing to look somewhere else This would be good to discuss in the module meeting. In the mean time, I think it's better to land this sooner than later (before bcon3) and treating the adjustment of that particular aspect as polish.
Sybren A. Stüvel added 1 commit 2023-09-26 14:30:47 +02:00
Christoph Lendenfeld approved these changes 2023-09-26 14:46:15 +02:00
Christoph Lendenfeld left a comment
Member

gets my green light
I definitely prefer the version with the background still colored, but if that can be tweaked later I am fine with either version now.

gets my green light I definitely prefer the version with the background still colored, but if that can be tweaked later I am fine with either version now.
Julian Eisel reviewed 2023-09-26 16:12:08 +02:00
@ -4777,0 +4714,4 @@
/* Little channel color rectangle. */
if (acf_show_channel_colors()) {
const float rect_width = 0.5f * ICON_WIDTH;
const float rect_margin = 2.0f * U.ui_scale;
Member

Should probably use UI_SCALE_FAC instead of U.ui_scale. The latter doesn't include the screen DPI (e.g. double point/pixel size for macOS).

Should probably use `UI_SCALE_FAC` instead of `U.ui_scale`. The latter doesn't include the screen DPI (e.g. double point/pixel size for macOS).
dr.sybren marked this conversation as resolved
@ -5610,0 +5604,4 @@
/* Little channel color rectangle. */
const bool show_group_colors = acf_show_channel_colors();
if (show_group_colors) {
const float rect_width = 0.5f * ICON_WIDTH;
Member

These are duplicated from above, so tend to get out of sync. Would recommend a function (or macro).

These are duplicated from above, so tend to get out of sync. Would recommend a function (or macro).
Author
Member

That's true of the entire drawing code in that function... It needs a proper redesign.
Having said that, I'll move a few things into macros so that at least these factors are ensured to be used consistently.

That's true of the entire drawing code in that function... It needs a proper redesign. Having said that, I'll move a few things into macros so that at least these factors are ensured to be used consistently.
dr.sybren marked this conversation as resolved
Sybren A. Stüvel added 2 commits 2023-09-26 16:13:47 +02:00
Sybren A. Stüvel added 1 commit 2023-09-26 16:32:09 +02:00
Author
Member

I'll remove @filedescriptor as a reviewer. He already face-to-face agreed that the Grease Pencil channel coloring should use the same as other animation channels when discussing this face-to-face.

I've also discussed with @Hjalti and Rik Schutte and they also agree that this PR is a good change.

I'll remove @filedescriptor as a reviewer. He already face-to-face agreed that the Grease Pencil channel coloring should use the same as other animation channels when discussing this face-to-face. I've also discussed with @Hjalti and Rik Schutte and they also agree that this PR is a good change.
Julian Eisel approved these changes 2023-09-26 16:33:30 +02:00
Julian Eisel left a comment
Member

Looks good to me on a quick glance.

Looks good to me on a quick glance.
Sybren A. Stüvel removed review request for Falk David 2023-09-26 16:33:49 +02:00
Nathan Vegdahl approved these changes 2023-09-26 16:57:16 +02:00
Nathan Vegdahl left a comment
Member

Just one minor nit (that was actually from previous code, but I think is worth cleaning up). Can take care of that while landing.

Just one minor nit (that was actually from previous code, but I think is worth cleaning up). Can take care of that while landing.
@ -228,1 +179,3 @@
}
/* FIXME: what happens when the indentation is 1 greater than what it should be
* (due to grouping)? */
int colOfs = 10 - 10 * indent;
Member

This variable name took me a bit to grok. colOffset would be better, I think.

This variable name took me a bit to grok. `colOffset` would be better, I think.
dr.sybren marked this conversation as resolved
Sybren A. Stüvel manually merged commit c524fbe623 into main 2023-09-29 08:44:13 +02:00
Sybren A. Stüvel added this to the Animation & Rigging project 2023-10-05 14:24:38 +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
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#112861
No description provided.