Files
test2/source
John Kiril Swenson 2314f59417 Refactor: Cleanup VSE retiming selection code
Retiming selection was way more complicated than it needed to be, with
lots of duplicate code between `sequencer_select_exec` and
`sequencer_retiming_key_select_exec` and logic scattered all over the
place.

This patch standardizes retiming selection so that all of its logic is
performed first. If it turns out that the cursor is not able to select
any keys, it continues with strip selection. This decreases linecount
and makes everything clearer.

There should be no regressions user-side, but this patch does fix a
couple bugs and makes retiming selection more robust:
- Prior to this patch, if no retiming keys were selected, attempting to
  toggle any key with the tweak tool would select and deselect the key
  immediately.
- Prior to this patch, retiming keys would still show if overlays were
  turned off, but "retiming display" was turned on.

This patch also renames/changes some functions to make them clearer:
- `retiming_keys_are_visible` -> `retiming_keys_can_be_displayed`, since
  having retiming keys on in the overlays does not guarantee that they
  are visible in any strips currently. Note that I've altered this
  function slightly too, this fixes the second bug mentioned above.
- `try_to_realize_virtual_keys` -> `try_to_realize_fake_keys`, to make
  naming more consistent with existing functions.
- Fix typo in `retiming_mousover_key_get`
- Remove `use_retiming_mode` helper function since new code doesn't need
  it -- was confusingly named anyways
- Add `key` and `key_owner` arguments to
  `sequencer_retiming_key_select_exec` and
  `sequencer_retiming_select_linked_time` to avoid having to recalculate
  the key at cursor position over and over again

Pull Request: https://projects.blender.org/blender/blender/pulls/125468
2024-07-29 20:25:26 +02:00
..