Animation: Match Slope slider #110567

Merged
Christoph Lendenfeld merged 24 commits from ChrisLend/blender:blend_to_infinity_slider into main 2023-08-17 10:28:56 +02:00

This patch has been authored by Ares Deveaux (#106517: Animation: blend to infinity slider)
I am just finishing it up.

It blends selected keys to the slant of neighboring ones.
It is used to push the segment closer to the values of the next or previous pose.

This patch has been authored by Ares Deveaux ([#106517: Animation: blend to infinity slider](https://projects.blender.org/blender/blender/pulls/106517)) I am just finishing it up. It blends selected keys to the slant of neighboring ones. It is used to push the segment closer to the values of the next or previous pose. <video src="/attachments/718c03f5-3b81-4dde-980b-4b3216e6b904" controls></video>
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-07-28 11:39:40 +02:00
Christoph Lendenfeld added 18 commits 2023-07-28 11:39:47 +02:00
Christoph Lendenfeld requested review from Nate Rupsis 2023-07-28 11:40:02 +02:00
Christoph Lendenfeld added this to the Animation & Rigging project 2023-07-28 11:40:11 +02:00
Christoph Lendenfeld added 1 commit 2023-07-28 15:43:22 +02:00
Nathan Vegdahl reviewed 2023-07-31 13:11:22 +02:00
@ -682,0 +683,4 @@
{
const BezTriple *left_key = fcurve_segment_start_get(fcu, segment->start_index);
const BezTriple *right_key = fcurve_segment_end_get(fcu, segment->start_index + segment->length);
Member

Nothing to do with this PR, but just a side-note that these fcurve_segment_*_get() functions are (IMO) poorly named. I would expect them to get the first and last keys within the selected segment, but in fact they attempt to get the keys before and after the segment, which are not themselves part of the segment (falling back to the actual start and end key of the segment only if the before/after don't exist).

Further, fcurve_segment_start_get() takes an inclusive start index whereas fcurve_segment_end_get() takes an exclusive end index. That makes sense from the standpoint of easily computing the index to pass from the segment data, but these clearly aren't actually specific to segments since you can pass any indices you want.

And that brings me to it being weird that segment is even part of their name, since they don't take segments, they directly take indices.

All in all, it took me way more time than it should have to figure out what was going on here, and at first I thought we had off-by-one indexing errors (which isn't the case) because of how confusing this was.

Nothing to do with this PR, but just a side-note that these `fcurve_segment_*_get()` functions are (IMO) poorly named. I would expect them to get the first and last keys *within* the selected segment, but in fact they attempt to get the keys *before* and *after* the segment, which are not themselves part of the segment (falling back to the actual start and end key of the segment only if the before/after don't exist). Further, `fcurve_segment_start_get()` takes an inclusive start index whereas `fcurve_segment_end_get()` takes an exclusive end index. That makes sense from the standpoint of easily computing the index to pass from the segment data, but these clearly aren't actually specific to segments since you can pass any indices you want. And that brings me to it being weird that `segment` is even part of their name, since they don't take segments, they directly take indices. All in all, it took me way more time than it should have to figure out what was going on here, and at first I thought we had off-by-one indexing errors (which isn't the case) because of how confusing this was.
Member

imo, In the context of getting *left_key and *right_key i think fcurve_segment_*_get() is understandable. I do think there needs to be some comments around inclusivity.

imo, In the context of getting `*left_key` and `*right_key` i think ` fcurve_segment_*_get()` is understandable. I do think there needs to be some comments around inclusivity.
Member

Ah, interesting. I interpreted it to mean "left/right-most key of the segment". Although that's probably because of the fcurve_segment_*_get names, in my case.

In any case, I think the fcurve_segment_*_get() names are confusing, at least on their own. But that's definitely not for this PR (and also not @ChrisLend's code, ha ha).

Ah, interesting. I interpreted it to mean "left/right-most key of the segment". Although that's probably *because* of the `fcurve_segment_*_get` names, in my case. In any case, I think the `fcurve_segment_*_get()` names are confusing, at least on their own. But that's definitely not for this PR (and also not @ChrisLend's code, ha ha).
Member

The code looks good to me. But I have a couple of thoughts:

  • The name "Blend to Infinity" was not at all suggestive to me of what this feature does. How does "Blend to Slope" sound?
  • I wonder if it would be worth matching the slope of the handle of the prev/next key when that's been manually set (not for auto-handles).
The code looks good to me. But I have a couple of thoughts: - The name "Blend to Infinity" was not at all suggestive to me of what this feature does. How does "Blend to Slope" sound? - I wonder if it would be worth matching the slope of the *handle* of the prev/next key when that's been manually set (not for auto-handles).
Nate Rupsis approved these changes 2023-07-31 16:37:54 +02:00
Nate Rupsis left a comment
Member

lgtm.

I think we should bring up the name in the next Animation module meeting. I think an argument could be made either way, but would be good to get others feedback.

lgtm. I think we should bring up the name in the next Animation module meeting. I think an argument could be made either way, but would be good to get others feedback.
Member

I think we should bring up the name in the next Animation module meeting.

Good call. Added to the agenda.

> I think we should bring up the name in the next Animation module meeting. Good call. Added to the agenda.
Member

The consensus in the module meeting was to rename this to "Match Slope". Other than that, this looks ready to land to me.

The consensus in the module meeting was to rename this to "Match Slope". Other than that, this looks ready to land to me.
Christoph Lendenfeld added 2 commits 2023-08-10 16:52:12 +02:00
Christoph Lendenfeld added 1 commit 2023-08-10 17:10:20 +02:00
Nathan Vegdahl reviewed 2023-08-10 17:18:28 +02:00
@ -1077,0 +1129,4 @@
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
static int blend_to_infinity_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Member

Missed an infinity.

Missed an infinity.
Author
Member

thanks, must be going blind

thanks, must be going blind
nathanvegdahl marked this conversation as resolved
Christoph Lendenfeld changed title from Animation: Blend to Infinity slider to Animation: Match Slope slider 2023-08-10 17:20:19 +02:00
Christoph Lendenfeld added 2 commits 2023-08-11 16:34:42 +02:00
Nathan Vegdahl approved these changes 2023-08-14 14:31:16 +02:00
Nathan Vegdahl left a comment
Member

Looks good to me!

Looks good to me!
Christoph Lendenfeld merged commit bb8766ef01 into main 2023-08-17 10:28:56 +02:00
Christoph Lendenfeld deleted branch blend_to_infinity_slider 2023-08-17 10:28:58 +02:00
Christoph Lendenfeld removed this from the Animation & Rigging project 2023-11-23 10:56:05 +01: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
3 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#110567
No description provided.