Anim: Add option to show modified property on slider #119920
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119920
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChrisLend/blender:slider_show_modified_property"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds the feature of displaying which property is modified
to the slider GUI.
This is useful in cases like #117287: Anim: Add Sharpness to Ease operator
where the slider can modify different properties during the modal operation.
The string is optional and will be empty by default.
This label is placed to the left of the slider where the percentage was usually located.
The percentage has now been moved to the right.
In use on the Ease operator
Nice!
"Property name" is a bit ambiguous, as it could mean different things (could be the RNA name). I think it would be better to use either
label
orui_name
instead ofname
, so that it's clear it's a for-humans UI thing.Good to have this documented. I do feel that this ordering (label to the right of the value) makes this part of the UI feel a bit inconsistent with the rest of Blender's UI. Would it be much work to move the factor to the right, and the label to the left of the slider? I also wonder what @pablovazquez thinks about this.
@ -83,1 +84,4 @@
/* Optional string that will display next to the slider to indicate which property is modified
* right now. */
char property_name[SLIDER_PROPERTY_STRING_SIZE];
Given that this is runtime data that's owned by
tSlider
anyway, do we need a fixed-sizechar[]
? Or could we just usestd::string
instead? That could get rid of the fixed array size. Passing references around could then be via aStringRef
instead ofconst char *
.@ -363,1 +382,4 @@
fontid, factor_string_pos_x, (region->winy / 2) - factor_string_pixel_size[1] / 2, 0.0f);
BLF_draw(fontid, factor_string, sizeof(factor_string));
if (slider->property_name) {
warning: address of array 'slider->property_name' will always evaluate to 'true'
I think you want
if (slider->property_name[0])
Not at all. The reason why it was on the left in the first place is because it means the % will be less prone to jumping around. But I think we can mitigate that. I agree it would make more sense to have the unit name on the left
Thanks for bringing this up!
Yes. Since the UI is meant to be read left-to-right, it would be more consistent to have the label on the left and values on the right.
@dr.sybren @pablovazquez I changed the order of the slider to read left to right.
The percentage number on the right does jump around a bit now, but I don't feel it is too distracting.
Example images in the PR description have been updated.
Thanks! Haven't compiled this patch yet but by looking at the screenshots it seems the label is overflowing the background?
Made the image brighter so it's easier to spot:
It's also rounded on the left but not the right, might have to do with that? Some kind of offset.
@pablovazquez well spotted. Didn't see that on my screen but I forgot to change the backdrop padding with the text
Just a small (but important) note, can be handled when landing.
@ -364,0 +384,4 @@
float property_name_pixel_size[2];
BLF_width_and_height(fontid,
slider->property_label.c_str(),
sizeof(slider->property_label),
sizeof
is incorrect here, I think you needslider->property_label.length()
@ -364,0 +391,4 @@
main_line_rect.xmin - text_padding - property_name_pixel_size[0],
(region->winy / 2) - property_name_pixel_size[1] / 2,
0.0f);
BLF_draw(fontid, slider->property_label.c_str(), sizeof(slider->property_label));
same
sizeof
here