Allow select range in animation editor #104565

Merged
Pratik Borhade merged 19 commits from PratikPB2123/blender:T103855-anim-select-extend into main 2023-05-05 17:46:14 +02:00

19 Commits

Author SHA1 Message Date
Pratik Borhade 7f7709f397 Replace clear_selection function with ANIM_anim_channels_select_set 2023-05-05 17:58:01 +05:30
Pratik Borhade 8e3bb1f6e0 Fix minor error in 981cb0a3de 2023-05-05 17:40:18 +05:30
Pratik Borhade 6075eb8015 Add switch case for other channel types in ANIM_is_active_channel 2023-05-05 16:24:44 +05:30
Pratik Borhade 981cb0a3de Cleanup
- `is_active_found` removed
- Replace ternary operator with `if` block
2023-05-05 16:01:55 +05:30
Pratik Borhade b3c299277e New function to find out the given channel is active
ANIM_is_active_channel() returns whether given channel is active
2023-05-02 16:23:08 +05:30
Pratik Borhade c31fed5b2b Code cleanup
- Document `change_active` parameter
- Fix code comments
- Remove default clauses
- Rename `animchannel_active_check` to `animchannel_has_active_of_type`
2023-05-02 15:55:01 +05:30
Pratik Borhade faa5a9bebb Include group like channels in animchannel_clear_selection 2023-04-16 16:18:08 +05:30
Pratik Borhade f444b3b542 Include selection of pose-group channels 2023-04-16 12:47:39 +05:30
Pratik Borhade 488fbf4f1b Following fixes:
- Restrict channel selection to similar types. Channels that matches with the type of
  shift-clicked channel are selected (Example: Fcurve only). This prevents selection
  of Gpencil and fcurve channel at once. But for now its better to not
  allow both at once, see: #106116
- Change selection mode when no active element is found. Otherwise all channels below
  the clicked channel would get selected.
2023-04-15 16:19:01 +05:30
Pratik Borhade b0e3eacaad Include group-like channels when selecting range
Group-channels are only included in selection when the channel type
of clicked element matches. That is, groups are selected along with the
general channels when clicked on group.

- `is_selection_allowed` decides whether to include group channels or
  not
 - Clear general channels when object-channel is selected
 (`ANIM_anim_channels_select_set` added). Otherwise there would be two
 active channels.
2023-04-11 13:39:43 +05:30
Pratik Borhade cfe2266b73 Replace select_range logic and move function definition above 2023-04-09 16:49:13 +05:30
Pratik Borhade d4b81d5ed2 Use is_active_elem to skip range selection of single element 2023-03-28 16:18:28 +05:30
Pratik Borhade c95aca3571 Cleanup and use of is_cursor_elem
- Add `break` within braces
- Use `is_cursor_elem` to check whether clicked channel and current
  `ale` is same
2023-03-24 21:08:21 +05:30
Pratik Borhade 72dc98fb14 Minor changes
- Swap if-else code block
- Add comment
2023-03-09 08:47:50 +05:30
Pratik Borhade 0cdeaed781 Changes suggested by reviewer
- Ran clang format
- Add code comments
- Rename `selected` to `in_selection_range`
- Move condition of "active flag check" outside of for loop (now added
  in `click_select_channel` functions of individual channels)
- Tooltip for `extend_range` property
2023-03-05 17:18:46 +05:30
Pratik Borhade e6c71764e4 Range selection of gpencil layer 2023-03-05 16:30:45 +05:30
Pratik Borhade 1e8ef2e6e4 Merge branch 'main' into T103855-anim-select-extend 2023-03-05 10:41:28 +05:30
Pratik Borhade 8a24c92c08 Use break instead of return 2023-02-11 11:52:42 +05:30
Pratik Borhade b02bfb716f Allow select range in animation editor
Patch will allow range selection similar to outliner.
New function ANIM_animchannel_select_range created for range selection.
Similar to outliner, active fcurve remains unchanged when this operation is called.
New keymap is created to separate extend and extend range functionality.

Old Differential revision: https://archive.blender.org/developer/D17079
2023-02-10 17:29:54 +05:30