Anim: Add Sharpness to Ease operator #117287

Merged
Christoph Lendenfeld merged 20 commits from ChrisLend/blender:graph_slider_ease_ease into main 2024-03-22 13:22:45 +01:00

This PR extends the existing Ease operator with a sharpness property.

This means it has two parameters:

  • Curve Bend: Define which key to favor. At 0 it's exactly between the two keys.
  • Sharpness: Higher values make the change more abrupt.

During modal operation it is possible to switch the slider between those two by pressing TAB.

Sharpness 2.0 (default) Sharpness 1.0 Sharpness 4.0
image image image

Test Build
https://builder.blender.org/download/patch/PR117287/


This basically merges the "Ease Ease" operator from Ares Deveaux #106525: Animation: ease-ease slider with the existing "Ease" operator.
Compared to the original PR I changed the sigmoid function a bit to avoid creating jumps in the animation at the ends of the segments.

Visual comparison between the old and new Ease operator (old result in gray). With the new operator to match the old one, the "Curve Bend" needs to be either -1 or 1. After that you can play with the "Sharpness" parameter.
image

This PR extends the existing `Ease` operator with a sharpness property. This means it has two parameters: * Curve Bend: Define which key to favor. At 0 it's exactly between the two keys. * Sharpness: Higher values make the change more abrupt. During modal operation it is possible to switch the slider between those two by pressing `TAB`. | Sharpness 2.0 (default) | Sharpness 1.0 | Sharpness 4.0 | | - | - | - | | ![image](/attachments/2b739e0e-7fe6-4330-9688-7c541feec1f3) | ![image](/attachments/ff6d1ed5-dd24-4d71-b616-f7ddfa22fb66) | ![image](/attachments/edc11ca5-6b2d-467e-9f0d-6280da6a43aa) | Test Build https://builder.blender.org/download/patch/PR117287/ ----- This basically merges the "Ease Ease" operator from Ares Deveaux [#106525: Animation: ease-ease slider](https://projects.blender.org/blender/blender/pulls/106525) with the existing "Ease" operator. Compared to the original PR I changed the sigmoid function a bit to avoid creating jumps in the animation at the ends of the segments. Visual comparison between the old and new Ease operator (old result in gray). With the new operator to match the old one, the "Curve Bend" needs to be either -1 or 1. After that you can play with the "Sharpness" parameter. ![image](/attachments/dac9603f-0787-48ec-9653-9cded407d2e4)
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2024-01-18 15:48:33 +01:00
Christoph Lendenfeld added 3 commits 2024-01-18 15:48:46 +01:00
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
3dbb412be7
add comment and better defaults
Christoph Lendenfeld added this to the Animation & Rigging project 2024-01-18 15:50:16 +01:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR117287) when ready.
Sybren A. Stüvel approved these changes 2024-01-19 12:35:05 +01:00
Dismissed
Sybren A. Stüvel left a comment
Member

The code LGTM, apart from a seemingly out of date comment.
Let's wait with landing this PR until we know whether it can replace the Ease operator.

The code LGTM, apart from a seemingly out of date comment. Let's wait with landing this PR until we know whether it can replace the Ease operator.
@ -704,1 +704,4 @@
static float s_curve(const float x, const float width, const float shift)
{
/* Formula for 'S' curve we use for the "ease" sliders. The shift values move the curve verticaly

This comment seems to be out of sync with the parameters.

This comment seems to be out of sync with the parameters.
Christoph Lendenfeld added 2 commits 2024-01-19 12:54:14 +01:00
Christoph Lendenfeld added 1 commit 2024-01-19 12:55:43 +01:00
Christoph Lendenfeld added 1 commit 2024-01-25 10:27:08 +01:00
Christoph Lendenfeld added 1 commit 2024-01-26 11:52:03 +01:00
Christoph Lendenfeld added 1 commit 2024-01-26 12:22:30 +01:00
First-time contributor

Love the new ease to ease slider! Would it be possible to add a button to toggle the width setting while using the slider instead of having to apply the ease, then open up the menu? One of the benefits of the old ease slider is that with its easing at 0 you can quickly make a bunch of keys move in a linear speed with one click. With the ease to ease slider, you need to apply the operator, open the menu, and turn the width down to 0. I'd imagine having a button to toggle the width would make that faster.

Cheers!

Love the new ease to ease slider! Would it be possible to add a button to toggle the width setting while using the slider instead of having to apply the ease, then open up the menu? One of the benefits of the old ease slider is that with its easing at 0 you can quickly make a bunch of keys move in a linear speed with one click. With the ease to ease slider, you need to apply the operator, open the menu, and turn the width down to 0. I'd imagine having a button to toggle the width would make that faster. Cheers!
Author
Member

@Raymond-Luc thanks for the feedback. I wasn't aware that the Ease operator is used to align keys in a straight line.

Toggling the width is a bit tricky. Since it's a factor it would ideally be on the scroll wheel, but that would leave out tablet users.
We could add two buttons, one for shrinking the width and one for growing it.

Or have a button that toggles the property affected by the slider. E.g. it would default to "Sharpness" but by pressing D it would then affect "Width". We've never done such a concept before though.

Considering BCon3 (feature freeze) is approaching, we might want to keep both operators so we have a chance of landing this.

@Raymond-Luc thanks for the feedback. I wasn't aware that the `Ease` operator is used to align keys in a straight line. Toggling the width is a bit tricky. Since it's a factor it would ideally be on the scroll wheel, but that would leave out tablet users. We could add two buttons, one for shrinking the width and one for growing it. Or have a button that toggles the property affected by the slider. E.g. it would default to "Sharpness" but by pressing `D` it would then affect "Width". We've never done such a concept before though. Considering BCon3 (feature freeze) is approaching, we might want to keep both operators so we have a chance of landing this.
Christoph Lendenfeld added this to the 4.2 LTS milestone 2024-02-06 10:40:35 +01:00
Author
Member

in the recent Animation & Rigging module meeting we decided to postpone this feature to 4.2 so we can have time to implement a functionality that toggles which property the slider affects.

E.g. by default it would affect the sharpness, but pressing TAB it would affect the width. The sharpness value would stay at the current value.

in the recent [Animation & Rigging module meeting](https://devtalk.blender.org/t/2024-02-01-animation-rigging-module-meeting/33182#patch-review-decision-time-4) we decided to postpone this feature to 4.2 so we can have time to implement a functionality that toggles which property the slider affects. E.g. by default it would affect the sharpness, but pressing TAB it would affect the width. The sharpness value would stay at the current value.
Christoph Lendenfeld added 3 commits 2024-02-29 15:22:45 +01:00
Christoph Lendenfeld changed title from Anim: Ease to Ease operator to Anim: Add Sharpness to Ease operator 2024-02-29 15:23:12 +01:00
Christoph Lendenfeld added 1 commit 2024-02-29 15:27:25 +01:00
Christoph Lendenfeld added 1 commit 2024-02-29 15:36:18 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
28e965a2bc
rename helper function
Author
Member

@blender-bot package

@Raymond-Luc a new build for you to test. Pressing TAB during the modal operation now switches which property the slider affects

@blender-bot package @Raymond-Luc a new build for you to test. Pressing `TAB` during the modal operation now switches which property the slider affects
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR117287) when ready.

I like the TAB to switch between the parameters. It feels intuitive to me, as typically in some form you'd also use the same key to toggle the input focus between different parameters.

When changing the sharpness, it goes up to 1000%. That's quite different from the PR description, where it's shown as a factor (4.0). Are these numerically equivalent? As in, is the 4.0 image actually a 400% sharpness? In that case I think it's fine, just want to check.

What are the numbers for, actually? 0% sharpness being linear makes sense to me, but what does 100% represent?

I like the `TAB` to switch between the parameters. It feels intuitive to me, as typically in some form you'd also use the same key to toggle the input focus between different parameters. When changing the sharpness, it goes up to `1000%`. That's quite different from the PR description, where it's shown as a factor (`4.0`). Are these numerically equivalent? As in, is the `4.0` image actually a `400%` sharpness? In that case I think it's fine, just want to check. What are the numbers for, actually? 0% sharpness being linear makes sense to me, but what does 100% represent?
Christoph Lendenfeld added 1 commit 2024-03-07 13:14:37 +01:00
Christoph Lendenfeld added 1 commit 2024-03-07 13:21:14 +01:00
Author
Member

When changing the sharpness, it goes up to 1000%. That's quite different from the PR description, where it's shown as a factor (4.0). Are these numerically equivalent? As in, is the 4.0 image actually a 400% sharpness? In that case I think it's fine, just want to check.

What are the numbers for, actually? 0% sharpness being linear makes sense to me, but what does 100% represent?

Good point, changed it so that with sharpness we have no unit and it goes from 0.0 to 10.0

> When changing the sharpness, it goes up to `1000%`. That's quite different from the PR description, where it's shown as a factor (`4.0`). Are these numerically equivalent? As in, is the `4.0` image actually a `400%` sharpness? In that case I think it's fine, just want to check. > > What are the numbers for, actually? 0% sharpness being linear makes sense to me, but what does 100% represent? Good point, changed it so that with sharpness we have no unit and it goes from 0.0 to 10.0
First-time contributor

Hey Christoph!

Sorry for the delay, its been a busy past week haha. I really like the new changes you've implemented! I did run into a issue where if you are in the modify sharpness part of the tool and hold ctrl while moving the slider to the left, I think you end up diving the curve by 0.

Steps to reproduce:

  • Use the ease slider on a set of keyframes
  • hit tab to go into the sharpness settings
  • while holding the CTRL key, move the slider all the way to 0

added a video and blendfile with the issue.

Hey Christoph! Sorry for the delay, its been a busy past week haha. I really like the new changes you've implemented! I did run into a issue where if you are in the modify sharpness part of the tool and hold ctrl while moving the slider to the left, I think you end up diving the curve by 0. Steps to reproduce: - Use the ease slider on a set of keyframes - hit tab to go into the sharpness settings - while holding the CTRL key, move the slider all the way to 0 added a video and blendfile with the issue.
Author
Member

@Raymond-Luc thanks for testing and finding that issue.
It's actually a bug with the slider itself, so I made a separate PR to fix it (which can land in 4.1)
#119367: Fix: Slider not respecting bounds when snapping to increments

Also on a tangent: You mentioned you quickly want to align curves in a line. The quickest way to do this now is to use Push-Pull and slide all the way to the left.

@Raymond-Luc thanks for testing and finding that issue. It's actually a bug with the slider itself, so I made a separate PR to fix it (which can land in 4.1) [#119367: Fix: Slider not respecting bounds when snapping to increments](https://projects.blender.org/blender/blender/pulls/119367) Also on a tangent: You mentioned you quickly want to align curves in a line. The quickest way to do this now is to use `Push-Pull` and slide all the way to the left.
Christoph Lendenfeld added 2 commits 2024-03-14 10:42:20 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
f6d1825150
Merge branch 'main' into graph_slider_ease_ease
Author
Member

@blender-bot package
new build with the divide by 0 issue now resolved

@blender-bot package new build with the divide by 0 issue now resolved
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR117287) when ready.
Christoph Lendenfeld added 1 commit 2024-03-19 11:01:28 +01:00
Christoph Lendenfeld added 1 commit 2024-03-19 11:09:48 +01:00
Christoph Lendenfeld requested review from Sybren A. Stüvel 2024-03-22 10:01:56 +01:00

As discussed in a module meeting (a while ago), it would be nice to show which setting is being modified:

screenshot of Blender's graph editor, with the property name influenced by the slider showing

This is for a followup commit, as it would impact all slider operators. Just wanted to mention it here to have it recorded in this PR ;-)

As discussed in a module meeting (a while ago), it would be nice to show which setting is being modified: ![screenshot of Blender's graph editor, with the property name influenced by the slider showing](/attachments/6865ac70-9da6-45ff-8d96-de5800cf3eb6) This is for a followup commit, as it would impact all slider operators. Just wanted to mention it here to have it recorded in this PR ;-)
101 KiB
Sybren A. Stüvel approved these changes 2024-03-22 13:04:06 +01:00
Christoph Lendenfeld merged commit 62f140e048 into main 2024-03-22 13:22:45 +01:00
Christoph Lendenfeld deleted branch graph_slider_ease_ease 2024-03-22 13:22:48 +01:00
Sign in to join this conversation.
No reviewers
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#117287
No description provided.