Fix #104514: GPencil merge down layer misses some frames #104558

Merged
Falk David merged 5 commits from amelief/blender:fix-gpencil-merge-down into main 2023-02-10 12:55:08 +01:00

When merging two gpencil layers, if the destination layer had a keyframe
where the source layer did not, strokes of the previous keyframe
in source layer were lost in that frame.

This happened because the merge operator was looping through
frames of the source layer and appending strokes in the
corresponding destination layer, but never completing
other frames than the ones existing in the source layer.

This patch fixes it by first adding in source layer
all frames that are in destination layer.

When merging two gpencil layers, if the destination layer had a keyframe where the source layer did not, strokes of the previous keyframe in source layer were lost in that frame. This happened because the merge operator was looping through frames of the source layer and appending strokes in the corresponding destination layer, but never completing other frames than the ones existing in the source layer. This patch fixes it by first adding in source layer all frames that are in destination layer.
Amélie Fondevilla added 1 commit 2023-02-10 10:08:34 +01:00
151fa4b503 Fix #104514: GPencil merge down layer misses some frames
When merging two gpencil layers, if the destination layer had a keyframe
where the source layer did not, strokes of the previous keyframe
in source layer were lost in that frame.

This happened because the merge operator was looping through
frames of the source layer and appending strokes in the
corresponding destination layer, but never completing
other frames than the ones existing in the source layer.

This patch fixes it by first adding in source layer
all frames that are in destination layer.
Amélie Fondevilla requested review from Falk David 2023-02-10 10:09:01 +01:00
Falk David requested changes 2023-02-10 10:29:09 +01:00
Falk David left a comment
Member

This does not seem to solve the issue for me. Frame 2 is merged correctly, but frame 5 and 6 are missing the red "2".

This does not seem to solve the issue for me. Frame 2 is merged correctly, but frame 5 and 6 are missing the red "2".
Amélie Fondevilla changed title from Fix #104514: GPencil merge down layer misses some frames to WIP: Fix #104514: GPencil merge down layer misses some frames 2023-02-10 11:13:34 +01:00
Amélie Fondevilla force-pushed fix-gpencil-merge-down from 7673c1084e to 316d4cc0e4 2023-02-10 12:22:44 +01:00 Compare
Amélie Fondevilla requested review from Falk David 2023-02-10 12:24:45 +01:00
Falk David requested changes 2023-02-10 12:32:06 +01:00
Falk David left a comment
Member

Tested this and it seems to work correctly now 👍 . Just a small comment.

Tested this and it seems to work correctly now 👍 . Just a small comment.
@ -1262,3 +1262,3 @@
break;
}
if ((gpf->next) && (gpf->next->framenum > cframe)) {
if (!(gpf->next) || (gpf->next->framenum > cframe)) {
Member

I think adding a comment here would be good.
/* If this is the last frame or the next frame is at a later time, we found the right frame. */

I think adding a comment here would be good. `/* If this is the last frame or the next frame is at a later time, we found the right frame. */`
filedescriptor marked this conversation as resolved
Falk David changed title from WIP: Fix #104514: GPencil merge down layer misses some frames to Fix #104514: GPencil merge down layer misses some frames 2023-02-10 12:35:32 +01:00
Amélie Fondevilla added 2 commits 2023-02-10 12:48:54 +01:00
Amélie Fondevilla requested review from Falk David 2023-02-10 12:49:22 +01:00
Falk David approved these changes 2023-02-10 12:50:18 +01:00
Falk David left a comment
Member

Looks good!

Looks good!
Falk David merged commit dc9f7fe64f into main 2023-02-10 12:55:08 +01: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#104558
No description provided.