GPv3: Duplicate active keys operator #125369

Merged
Falk David merged 3 commits from PratikPB2123/blender:gpv3-duplicate-activekeys into main 2024-07-26 15:40:00 +02:00
Member

Port legacy frame_duplicate() operator.
Found this missing operator during #125261

Port legacy `frame_duplicate()` operator. Found this missing operator during #125261
Pratik Borhade added 1 commit 2024-07-24 13:21:31 +02:00
Port legacy `frame_duplicate()` operator.
Found this missing operator during #125261
Pratik Borhade requested review from Falk David 2024-07-24 13:21:42 +02:00
Pratik Borhade added this to the Grease Pencil project 2024-07-24 13:21:49 +02:00
Pratik Borhade added the
Module
Grease Pencil
label 2024-07-24 13:21:55 +02:00
Falk David requested changes 2024-07-25 14:45:04 +02:00
Dismissed
Falk David left a comment
Member

Thanks, added some comments.

Thanks, added some comments.
@ -810,0 +818,4 @@
const int current_frame = scene->r.cfra;
for (Layer *layer : grease_pencil.layers_for_write()) {
if (only_active && layer != active_layer) {
Member

I'd prefer if this if was outside the loop (since it's only two lines that need to be duplicated):

if (only_active && grease_pencil.has_active_layer()) {
   Layer &active_layer = *grease_pencil.get_active_layer();
   const std::optional<int> active_frame_number = active_layer.start_frame_at(current_frame);
   grease_pencil.insert_duplicate_frame(active_layer, active_frame_number.value(), current_frame, false);
} else {
   for (Layer *layer : grease_pencil.layers_for_write()) {
      const std::optional<int> active_frame_number = layer->start_frame_at(current_frame);
      grease_pencil.insert_duplicate_frame(*layer, active_frame_number.value(), current_frame, false);
   }
}
I'd prefer if this `if` was outside the loop (since it's only two lines that need to be duplicated): ```cpp if (only_active && grease_pencil.has_active_layer()) { Layer &active_layer = *grease_pencil.get_active_layer(); const std::optional<int> active_frame_number = active_layer.start_frame_at(current_frame); grease_pencil.insert_duplicate_frame(active_layer, active_frame_number.value(), current_frame, false); } else { for (Layer *layer : grease_pencil.layers_for_write()) { const std::optional<int> active_frame_number = layer->start_frame_at(current_frame); grease_pencil.insert_duplicate_frame(*layer, active_frame_number.value(), current_frame, false); } } ```
@ -810,0 +835,4 @@
static void GREASE_PENCIL_OT_frame_duplicate(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Duplicate active Frames";
Member

"Duplicate active frame(s)"

`"Duplicate active frame(s)"`
@ -810,0 +837,4 @@
/* identifiers */
ot->name = "Duplicate active Frames";
ot->idname = "GREASE_PENCIL_OT_frame_duplicate";
ot->description = "Make a copy of the active Grease Pencil Frame";
Member

"Make a copy of the active Grease Pencil frame(s)"

`"Make a copy of the active Grease Pencil frame(s)"`
Pratik Borhade added 1 commit 2024-07-26 13:52:19 +02:00
Pratik Borhade added 1 commit 2024-07-26 13:59:55 +02:00
Falk David approved these changes 2024-07-26 14:59:20 +02:00
Falk David left a comment
Member

LGTM

LGTM
Falk David merged commit 1da83ab046 into main 2024-07-26 15:40:00 +02:00
Author
Member

Thanks :)

Thanks :)
Pratik Borhade deleted branch gpv3-duplicate-activekeys 2024-07-27 13:25:26 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#125369
No description provided.