GPv3: Select frames by column #110523

Merged
Amélie Fondevilla merged 12 commits from amelief/blender:gpv3-keyframes-column-select into main 2023-07-28 16:18:47 +02:00

Implementation of column-based operators : "Columns on selected keys", "Column on current frame", and "Columns on selected markers" for grease pencil frames in the dopesheet.

Implementation of column-based operators : "Columns on selected keys", "Column on current frame", and "Columns on selected markers" for grease pencil frames in the dopesheet.
Amélie Fondevilla added this to the Grease Pencil project 2023-07-27 10:13:27 +02:00
Amélie Fondevilla requested review from Falk David 2023-07-27 10:13:39 +02:00
Iliya Katushenock reviewed 2023-07-27 16:54:19 +02:00
@ -74,0 +77,4 @@
BLI_assert((ked != nullptr));
CfraElem *ce;
ce = static_cast<CfraElem *>(MEM_callocN(sizeof(CfraElem), "CfraElem"));

MEM_cnew<CfraElem>(__func__)?

`MEM_cnew<CfraElem>(__func__)`?
amelief marked this conversation as resolved
Amélie Fondevilla force-pushed gpv3-keyframes-column-select from b37e486918 to 3ead10ead2 2023-07-27 17:29:26 +02:00 Compare
Amélie Fondevilla force-pushed gpv3-keyframes-column-select from 3ead10ead2 to 185ca1db85 2023-07-27 17:31:19 +02:00 Compare
Falk David requested changes 2023-07-27 17:45:24 +02:00
Falk David left a comment
Member

First review pass.

First review pass.
@ -70,6 +70,28 @@ bool layer_has_any_frame_selected(const bke::greasepencil::Layer *layer)
return false;
}
static void frame_to_cfraelem(KeyframeEditData *ked, const int frame_number)
Member

maybe append_selected_frame_to_key_edit_data ?

maybe `append_selected_frame_to_key_edit_data` ?
amelief marked this conversation as resolved
@ -72,1 +72,4 @@
static void frame_to_cfraelem(KeyframeEditData *ked,
const int frame_number,
const GreasePencilFrame &frame)
Member

The assert can be removed. Already checked by the caller.

The assert can be removed. Already checked by the caller.
amelief marked this conversation as resolved
@ -73,0 +75,4 @@
const GreasePencilFrame &frame)
{
BLI_assert((ked != nullptr));
CfraElem *ce;
Member

CfraElem *ce = MEM_cnew<CfraElem>(__func__);

`CfraElem *ce = MEM_cnew<CfraElem>(__func__);`
amelief marked this conversation as resolved
@ -73,0 +81,4 @@
ce->cfra = float(frame_number);
ce->sel = frame.is_selected();
BLI_addtail(&(ked->list), ce);
}
Member

maybe create_keyframe_edit_data_selected_frames_list ? Long but at least more descriptive 😅

maybe `create_keyframe_edit_data_selected_frames_list` ? Long but at least more descriptive 😅
Author
Member

Yes. I don't think this function is gonna be used anywhere else anyways. 😅

Yes. I don't think this function is gonna be used anywhere else anyways. 😅
amelief marked this conversation as resolved
@ -73,0 +83,4 @@
BLI_addtail(&(ked->list), ce);
}
void make_cfralist_selected_frames(KeyframeEditData *ked, const bke::greasepencil::Layer *layer)
Member

Remove double ().

Remove double `()`.
amelief marked this conversation as resolved
@ -1081,3 +1081,3 @@
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
ED_gpencil_layer_make_cfra_list(static_cast<bGPDlayer *>(ale->data), &ked.list, true);
if (U.experimental.use_grease_pencil_version3) {
Member

I think we should be checking the object type here instead of using the experimental flag.

I think we should be checking the object type here instead of using the experimental flag.
amelief marked this conversation as resolved
Falk David requested changes 2023-07-27 18:37:17 +02:00
Falk David left a comment
Member

Two more comments.

Two more comments.
@ -73,0 +86,4 @@
BLI_assert(ked != nullptr);
for (const auto &[frame_number, frame] : layer->frames().items()) {
if (frame.is_selected()) {
Member

Is this check needed now that above you set ce->sel = frame.is_selected(); ?

Is this check needed now that above you set `ce->sel = frame.is_selected();` ?
Author
Member

Yes, because in this function we want to build the list of frame that are selected. So we only want to call the function above for frames that are indeed selected.
Now that I think of it, append_selected_frame_to_key_edit_data should be called append_frame_to_key_edit_data, because this one does not care if the frame is selected or not.

Yes, because in this function we want to build the list of frame that are selected. So we only want to call the function above for frames that are indeed selected. Now that I think of it, `append_selected_frame_to_key_edit_data` should be called `append_frame_to_key_edit_data`, because this one does not care if the frame is selected or not.
filedescriptor marked this conversation as resolved
@ -1084,0 +1091,4 @@
break;
default:
/* Invalid channel type. */
BLI_assert(0);
Member

Use BLI_assert_unreachable();.

Use `BLI_assert_unreachable();`.
amelief marked this conversation as resolved
Falk David approved these changes 2023-07-28 10:27:05 +02:00
Falk David left a comment
Member

Looks good 👍

Looks good 👍
Amélie Fondevilla force-pushed gpv3-keyframes-column-select from 83aa04b07d to e7efeea9da 2023-07-28 16:00:24 +02:00 Compare
Amélie Fondevilla merged commit f7130d98c4 into main 2023-07-28 16:18:47 +02:00
Amélie Fondevilla deleted branch gpv3-keyframes-column-select 2023-07-28 16:18:48 +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
3 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#110523
No description provided.