[Sequencer Scripting] Manipulating keyframe data from user selections

I’m trying to create an Editor Utility Widget (EUW) that applies an interpolation curve to user selected keyframes in an active Sequencer. I have followed what I can from guides existing online and some experimentation but I am facing some challenges that I wonder if anyone has any additional context to share. Here’s a prototype UI (leftmost panel) which hopefully provides some context:

  1. Isolating user selected keyframes
    There is a method to get all keyframes but I am not sure how to filter and prune the selection to target only keyframes selected by the user. Seems like the only way I can see available is to get a specific keyframe based on index from the array of keyframes which would be quite tedious and less ideal from an end user UX perspective to specify manually.

  2. Filtering through the correct keyframe “type” automatically
    There exist multiple types of keyframe channel types. (For e.g., Transform Location uses ‘double’ vs Focal Length uses float etc.). Wondering how to automatically select the right type based on which type of track the user is trying to manipulate.

  3. Understanding sequencer tangents
    Sequencer uses a system of “Arrive Tangent, Leave Tangent, Arrive Tangent Weight, Leave Tangent Weight” and it has been tricky to understand how to convert CSS like transition tangent values that are based on a simple normalized (X1, Y1, X2, Y2) approach. Arrive/Leave tangents seem to be the angle but the values are very very sensitive and the tangent “weight” seems to be the length of the tangent handle but I can’t figure out the scale because they don’t appear to be normalized?

At this point I’m putting this project on an indefinite hold because it might be a bit overambitious for my skill level/understanding right now but hopefully someday I can learn how to make this possible. I think this could be helpful tool if it were working and make animating a lot more intuitive an efficient for artists. :slight_smile:

Did you make any progress with this? Struggling with the same issue.