GPv3: Keyframe on-click selection #110492

Merged
Falk David merged 28 commits from amelief/blender:gpv3-keyframes-click-select into main 2023-07-26 17:59:18 +02:00

Implementation of the click-selection operator of keyframes in the dopesheet, along with its alternatives : deselect all when no frames is hit, extend selection with shift, colum selection with alt, select all keyframes on current channel with ctrl+alt.

Includes the new following API functions :

  • select_frame_at : selects a frame in a layer at a specific time (if such frame exists),
  • select_all_frames : selects all frames of a layer,
  • select_layer_channel : selects a layer, and sets it as active (if layer is not null, otherwise the active layer is set null),
  • layer_has_frame_selected : checks if any of the frames in the layer is selected.
Implementation of the click-selection operator of keyframes in the dopesheet, along with its alternatives : deselect all when no frames is hit, extend selection with shift, colum selection with alt, select all keyframes on current channel with ctrl+alt. Includes the new following API functions : * `select_frame_at` : selects a frame in a layer at a specific time (if such frame exists), * `select_all_frames` : selects all frames of a layer, * `select_layer_channel` : selects a layer, and sets it as active (if layer is not null, otherwise the active layer is set null), * `layer_has_frame_selected` : checks if any of the frames in the layer is selected.
Amélie Fondevilla added this to the Grease Pencil project 2023-07-26 12:57:42 +02:00
Amélie Fondevilla changed title from WIP: GPv3: Keyframe on-click selection. to GPv3: Keyframe on-click selection. 2023-07-26 14:46:22 +02:00
Amélie Fondevilla requested review from Falk David 2023-07-26 14:47:28 +02:00
Falk David changed title from GPv3: Keyframe on-click selection. to GPv3: Keyframe on-click selection 2023-07-26 14:47:47 +02:00
Falk David requested changes 2023-07-26 14:53:24 +02:00
Falk David left a comment
Member

Few initial comments.

Few initial comments.
@ -25,0 +64,4 @@
{
for (auto item : layer->frames().items()) {
const GreasePencilFrame &frame = item.value;
if ((frame.flag & GP_FRAME_SELECTED) != 0) {
Member

Similar to how we have functions on the GreasePencilFrame like is_implicit_hold() I think it makes sense to add a is_selected() one.

Similar to how we have functions on the `GreasePencilFrame` like `is_implicit_hold()` I think it makes sense to add a `is_selected()` one.
amelief marked this conversation as resolved
@ -58,0 +74,4 @@
/**
* Checks if any frame of the \a layer is selected.
*/
bool layer_has_frame_selected(const bke::greasepencil::Layer *layer);
Member

Maybe layer_has_any_frame_selected(...)?

Maybe `layer_has_any_frame_selected(...)`?
amelief marked this conversation as resolved
@ -1843,3 +1877,1 @@
if (ale != nullptr && ale->data != nullptr && ale->type == ANIMTYPE_GPLAYER) {
bGPdata *gpd = (bGPdata *)ale->id;
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
if (U.experimental.use_grease_pencil_version3) {
Member

I wonder if the check for the experimental option is still needed here.
Especially with the ale->type == ANIMTYPE_GREASE_PENCIL_LAYER check afterwards.

I wonder if the check for the experimental option is still needed here. Especially with the `ale->type == ANIMTYPE_GREASE_PENCIL_LAYER` check afterwards.
amelief marked this conversation as resolved
Amélie Fondevilla force-pushed gpv3-keyframes-click-select from 63e95c5665 to f7960114bd 2023-07-26 14:54:38 +02:00 Compare
Amélie Fondevilla added 4 commits 2023-07-26 15:05:58 +02:00
Member

@blender-bot build

@blender-bot build
Falk David approved these changes 2023-07-26 16:20:48 +02:00
Falk David left a comment
Member

Two small comments, but otherwise LGTM!

Two small comments, but otherwise LGTM!
@ -57,1 +59,4 @@
void select_layer_channel(GreasePencil *grease_pencil, bke::greasepencil::Layer *layer);
void set_active_layer(GreasePencil *grease_pencil, bke::greasepencil::Layer *layer);
Member

This can be reomved.

This can be reomved.
amelief marked this conversation as resolved
@ -58,0 +72,4 @@
void select_all_frames(bke::greasepencil::Layer *layer, const short select_mode);
/**
* Checks if any frame of the \a layer is selected.
Member

Returns true if any frame of the \a layer is selected.

`Returns true if any frame of the \a layer is selected.`
amelief marked this conversation as resolved
Amélie Fondevilla added 2 commits 2023-07-26 16:23:05 +02:00
Falk David merged commit 0c07fb50c8 into main 2023-07-26 17:59:18 +02:00
Falk David deleted branch gpv3-keyframes-click-select 2023-07-26 17:59:20 +02:00
Sign in to join this conversation.
No reviewers
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
2 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#110492
No description provided.