Summary:
This patch adds timing functionality to the Animation Timeline Docker's "Insert N Keyframes" menu actions. Out of necessity, it also replaces the create-on-demand QInputDialog with a new TimelineInsertKeyframesDialog that was designed as a drop-in replacement that allows for getting more than a single variable of user input (i.e. frame count and timing) and which could easy be given more functionality in the future.
{F5845888}
The motivation behind this patch was to improve the "Insert N Keyframes Right/Left" action workflow by giving the animator control of frame timing. Previously, those actions worked by adding a number of immediately adjacent frames based on the user's desired number of frames to insert.
In animation, keyframes that are immediately adjacent to each other are described as being "on 1s", but other timings are also common - "on 2s", "on 3s", etc. - in which drawings are held for different amounts of time. Animations typically maintain a particular rhythm for a span of frames, but it's also very common for different parts of a single animation to switch timings.
This patch improves upon existing functionality to facilitate animating on 1s, 2s, 3s, and others. Now, a Krita user can specify a timing of 2 to quickly and easily insert keyframes "on 2s", a timing of 3 to insert "on 3s", and so on, allowing even longer timings if desired.
( Pair-programmed on a sunny Portland Saturday with @eoinoneill, of course! =] )
Test Plan:
1. Right-click a position on the animation Timeline docker.
2. Select "Keyframes > Insert N Keyframes Right" or "Keyframes > Insert N Keyframes Left".
3. A new dialog windows should pop up, asking for a number of frames and a timing.
4. Test different values as well as both the "Cancel" and "OK" buttons and check for predictable behavior in a variety of cases.
Reviewers: #krita, #krita_abyss, dkazakov, rempt, scottpetrovic, Bollebib
Subscribers: #krita_abyss, #krita, eoinoneill
Tags: #krita_abyss
Differential Revision: https://phabricator.kde.org/D12843